This element is created by setting the type attribute of a textbox
to autocomplete
. It is used to create a textbox with a popup containing a list of possible completions for what the user has started to type.
The autocomplete functionality is handled through one of more session objects, each of which can return a set of results given the current value of the textbox. The sessions can be set using the searchSessions
attribute or by calling the addSession
method.
(example needed)
accesskey
label
attribute for the element.
alwaysopenpopup
Obsolete since Gecko 1.9.1true
, the autocomplete popup will be displayed even when there are no matches. If false
, the default value, the popup will be hidden. This attribute is obsolete as of Gecko 1.9.1; to control the display of the popup, use the minresultsforpopup
attribute instead.autocompletesearch
New in Thunderbird 2Requires SeaMonkey 1.1nsIAutoCompleteSearch
interface. The components are created using the name @mozilla.org/autocomplete/search;1?name=
where name is listed in this attribute.search-autocomplete
Requires SeaMonkey 2.1places-tag-autocomplete
Requires SeaMonkey 2.1mydomain
New in Thunderbird 3 Requires SeaMonkey 2.0history
Requires SeaMonkey 2.0form-history
Requires SeaMonkey 2.0file
(Linux only)gloda
New in Thunderbird 3addrbook
New in Thunderbird 3 Requires SeaMonkey 2.0ldap
New in Thunderbird 25 Requires SeaMonkey 2.22autocompletesearchparam
New in Thunderbird 2 Requires SeaMonkey 1.1autoFill
Obsolete since Gecko 1.9.1true
, the best match will be filled into the textbox as the user types. If false
, the default, the value will not be filled in until the user selects an item. As of Gecko 1.9.1, this attribute is now always specified in lower case.autoFillAfterMatch
Obsolete since Gecko 1.9.1true
, the entire text of the best match will be displayed at the end of the input. If false
, only the text that hasn't been entered yet will be filled in. The textbox.autoFill
attribute must be set to true
to use this feature. As of Gecko 1.9.1, this attribute is superseded by the completedefaultindex
attribute.autofill
New in Thunderbird 3 Requires SeaMonkey 2.0true
, the best match will be filled into the textbox as the user types. If false
, the default, the value will not be filled in until the user selects an item.completedefaultindex
New in Thunderbird 3 Requires SeaMonkey 2.0true
, the best match value will be filled into the textbox as the user types. If set to false
or omitted, the value must be selected from the list.disableAutocomplete
Obsolete since Gecko 1.9.1true
, the autocomplete behavior will be disabled. You might use a script to change this attribute. If false
, the default, autocomplete is enabled. As of Gecko 1.9.1, this attribute is now always specified in lower case.disableautocomplete
New in Thunderbird 3Requires SeaMonkey 2.0true
, the autocomplete behavior will be disabled. You might use a script to change this attribute. If false
, the default, autocomplete is enabled.disabled
command
event will not fire. In the case of form elements, it will not be submitted. Do not set the attribute to true
, as this will suggest you can set it to false
to enable the element again, which is not the case.
disabled
attribute is allowed only for form controls. Using it with an anchor tag (an <a>
link) will have no effect.disabled
property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.disablehistory
Obsolete since Gecko 2.0false
, an arrow button will appear on the end of the textbox which will open a dropdown menu of all available results. The default value is true
, hiding the dropdown button. This attribute only works correctly in SeaMonkey 1.x; for Thunderbird and SeaMonkey 2.0 you should also set the enablehistory
attribute; as of Gecko 2.0 this attribute is completely superseded by it.enablehistory
New in Thunderbird 1Requires SeaMonkey 2.0true
, an arrow button will appear on the end of the textbox which, when pressed, will open a dropdown menu of all available results.focused
true
if the element is focused.forceComplete
Obsolete since Gecko 1.9.1true
, the textbox will be filled in with the best match when it loses the focus. If false
, it will only be filled in when the user selects an item. As of Gecko 1.9.1, this attribute is now always specified in lower case.forcecomplete
New in Thunderbird 3Requires SeaMonkey 2.0true
, the textbox will be filled in with the best match when it loses the focus. If false
, it will only be filled in when the user selects an item.highlightnonmatches
New in Thunderbird 3 Requires SeaMonkey 2.0true
, then the autocomplete field will be highlighted when no match has been found.ignoreBlurWhileSearching
Obsolete since Gecko 1.9.1true
, blur events are ignored while searching, which means that the autocomplete popup will not disappear. As of Gecko 1.9.1, this attribute is now always specified in lower case.ignoreblurwhilesearching
New in Thunderbird 3Requires SeaMonkey 2.0true
, blur events are ignored while searching, which means that the autocomplete popup will not disappear.inputtooltiptext
maxlength
maxrows
minResultsForPopup
Obsolete since Gecko 1.9.1minresultsforpopup
New in Thunderbird 3Requires SeaMonkey 2.0nomatch
true
if the last search resulted in no matches.An onchange attribute is an event listener to the object for the Event change. A change event is fired in different ways for different XUL Input Elements as listed below:
onchange
TextBox | When Enter key is pressed |
Radio/Check Box | When the state is changed |
Select List | When the selected item is changed |
The script context at this point can only access the following things:
<?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findfile-window" title="Find Files" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="text/javascript"> function myFunction(e){ /* Do something cool here or just say the below */ alert(e.target.nodeName); } </script> <textbox id="find-text" onchange="return myFunction(event);"/> </window>
onerrorcommand
onsearchcomplete
New in Thunderbird 3Requires SeaMonkey 2.0ontextcommand
Obsolete since Gecko 1.9.1ontextentered
attribute.ontextentered
New in Thunderbird 3Requires SeaMonkey 2.0ontextrevert
Obsolete since Gecko 1.9.1ontextreverted
attribute.ontextreverted
New in Thunderbird 3Requires SeaMonkey 2.0readonly
true
, then the user cannot change the value of the element. However, the value may still be modified by a script.searchSessions
Obsolete since Gecko 26history
: The user's URL history is searched. Obsolete since Gecko 3addrbook
: The user's address book is searched. Obsolete since Gecko 3ldap
: The user's LDAP directories are searched. Obsolete since Gecko 25showCommentColumn
Obsolete since Gecko 1.9.1true
, a comment column appears in the popup. For the URL history, the comment column will contain the page titles associated with each URL. If this attribute is not specified, the comment column doesn't appear. As of Gecko 1.9.1, this attribute is now always specified in lower case.showcommentcolumn
New in Thunderbird 3Requires SeaMonkey 2.0true
, a comment column appears in the popup. For the URL history, the comment column will contain the page titles associated with each URL. If this attribute is not specified, the comment column doesn't appear.showpopup
true
, the popup will be shown. If false
, the popup will not be shown, but the autocomplete results will still be available. You can set this to false
and set the autoFill
attribute to true
to emulate a Communicator 4.x style autocomplete textbox. The default value is true
.size
tabindex
tab
" key. Elements with a higher tabindex
are later in the tab sequence.tabScrolling
Obsolete since Gecko 1.9.1true
, the user may cycle through the results list by pressing the Tab key. If false
, the default, the Tab key moves the focus to the next element.As of Gecko 1.9.1, this attribute is now always specified in lower case.tabscrolling
New in Thunderbird 3Requires SeaMonkey 2.0true
, the user may cycle through the results list by pressing the Tab key. If false
, the default, the Tab key moves the focus to the next element.timeout
type
autocomplete
number
decimalplaces
, min
, max
, increment
, wraparound
, hidespinbuttons
, and textbox.value
.password
search
searchbutton
attribute is set to true
, the command event is only fired if the user presses the search button or presses the Enter
key. You may specify grey text to appear when the search box is empty using the emptytext
attribute, and a timeout may be set for the command event using the timeout
attribute (defaults to 500).timed
timeout
attribute. The command event will fire if the user presses the Enter
key. The timed
type is deprecated in Gecko 1.9.1 and the search
textbox may be used instead.userAction
none
typing
scrolling
value
menulist
elements, the contents, as visible to the user, are read and set using the Menulist.value syntax. For those elements, setAttribute("value", myValue) and getAttribute("value") do not access or affect the contents displayed to the user.
accessible
nsIAccessible
alwaysOpenPopup
Obsolete since Gecko 1.9.1alwaysopenpopup
attribute.autoFillAfterMatch
Obsolete since Gecko 1.9.1autoFillAfterMatch
attribute.completeDefaultIndex
New in Thunderbird 3Requires SeaMonkey 2.0completedefaultindex
attribute.disableAutocomplete
disableautocomplete
(or disableAutocomplete
) attribute.editable
true
if the element is editable. Autocomplete fields are editable so this property always returns true
for those.
forceComplete
forcecomplete
(or forceComplete
) attribute.highlightNonMatches
New in Thunderbird 1 Requires SeaMonkey 1.0highlightnonmatches
attribute.ignoreBlurWhileSearching
ignoreblurwhilesearching
(or ignoreBlurWhileSearching
) attribute.inputField
isSearching
true
while a search is occuring.isWaiting
true
during the period while waiting for the timeout between the time when a user has pressed a key and a search is performed.label
label
attribute. Gets the label
attribute if it is present and not empty. Otherwise it returns the value
of the associated label
element, if applicable. Otherwise it returns the placeholder
or emptyText
property. The getter is mostly useful for screen readers.
Note: Prior to Firefox 3, and always in Thunderbird and SeaMonkey, the label property of an autocomplete textbox returns its value, for compatibility with the menulist
element.
maxLength
minResultsForPopup
minresultsforpopup
(or minResultsForPopup
) attribute.noMatch
true
if the last search resulted in no matches.popup
New in Thunderbird 14 Requires SeaMonkey 2.11popup
element that should appear when the user clicks on the textbox.Note: This property is readonly in Thunderbird and SeaMonkey.
popupOpen
New in Thunderbird 15 Requires SeaMonkey 2.12resultsPopup
searchCount
New in Thunderbird 15 Requires SeaMonkey 2.12searchParam
New in Thunderbird 15 Requires SeaMonkey 2.12autocompletesearchparam
attribute.searchSessions
Obsolete since Gecko 26searchSessions
attribute.selectionEnd
selectionStart
property. The value specifies the index of the character after the selection. If this value is equal to the value of the selectionStart
property, no text is selected, but the value indicates the position of the caret (cursor) within the textbox.selectionStart
selectionEnd
property. The value specifies the index of the first selected character.sessionCount
showCommentColumn
showcommentcolumn
(or showCommentColumn
) attribute.tabScrolling
tabscrolling
(or tabScrolling
) attribute.textLength
textValue
New in Thunderbird 15 Requires SeaMonkey 2.12value
property.Note: Setting the value causes an input event to be generated without triggering autocompletion.
userAction
userAction
attribute.value
value
attribute. For textbox
and user editable menulist
elements, the contents, as visible to the user, are read and set using the Textbox.value
and Menulist.value syntax.
addSession( session )
Obsolete since Gecko 26nsIAutoCompleteSession
nsIAutoCompleteSession
interface. This method returns the object passed in.clearResults()
getDefaultSession
getResultAt( index )
Obsolete since Gecko 26nsIAutoCompleteItem
nsIAutoCompleteItem
.getResultCount( session )
getResultValueAt( index )
getSession( index )
Obsolete since Gecko 26nsIAutoCompleteSession
nsIAutoCompleteSession
.getSessionByName( name )
Obsolete since Gecko 26nsIAutoCompleteSession
nsIAutoCompleteSession
.getSessionResultAt( session, index )
Obsolete since Gecko 26
getSessionStatusAt( index )
Obsolete since Gecko 26getSessionValueAt( session, index )
removeSession( session )
Obsolete since Gecko 26nsIAutoCompleteSession
interface.select()
setSelectionRange( start, end )
syncSessions( autoCompleteElement )
Obsolete since Gecko 26nsIAccessibleProvider
, nsIDOMXULMenuListElement