This element is created by setting the type attribute of the 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.
Toolkit applications (such as Firefox) use a different autocomplete mechanism than the Mozilla suite. The example below will create an autocomplete textbox that will search the user's history.
<textbox type="autocomplete" autocompletesearch="history"/>
accesskey
label
attribute for the element.
autocompletepopup
id
of a popup
element used to hold autocomplete results for the element.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.1completedefaultindex
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.completeselectedindex
true
, the text in the text field will be autocompleted as the user selects from the popup list.
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.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
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
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
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>
onsearchbegin
onsearchcomplete
New in Thunderbird 3Requires SeaMonkey 2.0ontextentered
New in Thunderbird 3Requires SeaMonkey 2.0ontextreverted
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.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.showimagecolumn
true
, an image column appears in the popup. There is no default styling of this image, but the class name returned by the results appears in the property list for the column. If this attribute is not specified, the image column doesn't appear.size
tabindex
tab
" key. Elements with a higher tabindex
are later in the tab sequence.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.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.
accessibleType
completeDefaultIndex
New in Thunderbird 3Requires SeaMonkey 2.0completedefaultindex
attribute.controller
nsIAutoCompleteController
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
maxLength
minResultsForPopup
minresultsforpopup
(or minResultsForPopup
) attribute.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.12searchCount
New in Thunderbird 15 Requires SeaMonkey 2.12searchParam
New in Thunderbird 15 Requires SeaMonkey 2.12autocompletesearchparam
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.showCommentColumn
showcommentcolumn
(or showCommentColumn
) attribute.showImageColumn
showimagecolumn
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.
type
autocomplete
to have an autocomplete textbox.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.
getSearchAt( index )
autocompletesearch
attribute.onSearchComplete()
onsearchcomplete
event handler. You should not call this method yourself.onTextEntered()
ontextentered
event handler. You should not call this method yourself.onTextReverted()
ontextreverted
event handler. You should not call this method yourself.select()
setSelectionRange( start, end )
nsIAccessibleProvider
, nsIAutoCompleteInput
, nsIDOMXULMenuListElement