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.
Attributes:
Attributes inherited from textbox
If set to true, 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.
If true, the autocomplete behavior will be disabled. You might use a script to change this attribute. If false, the default, autocomplete is enabled.
If true, the default value, the popup will be stretched to the width of the textbox. If false, you must set the width of the popup yourself.
If true, 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.
The number of rows to show in the results list at a time. A scrollbar will appear so the user can scroll through the remaining items.
This event handler is called when the textbox is displayed.
This event handler is called when a result is selected for the textbox.
This event handler is called when the user presses Escape to revert the textbox to its original uncompleted value.
Set to a keyword indicating what type of data to look up for autocomplete. You may set multiple types by separating their names by spaces. The following values are possible, although custom components may be installed which add others.
If true, a comment column appears in the popup. For the history, the comment contains the page titles. The default value is false.
If 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.
If true, 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.
Set to the number of milliseconds to wait between when the users presses a key and the results list updates. The default value is 50, which is very fast.
This attribute will be set to the action the user is currently performing. Possible values:
Properties and Methods:
Properties and Methods inherited from textbox
Adds a new session object to the autocomplete widget. This can be used to create a customized autocomplete results list. The argument should be an object which implements the nsIAutoCompleteSession interface.
Gets and sets the value of the autoFill attribute.
Gets and sets the value of the autoFillAfterMatch attribute.
Clears the results list.
Gets and sets the value of the disableAutocomplete attribute.
Gets and sets the value of the flexPopup attribute.
Gets and sets the value of the focused attribute.
Gets and sets the value of the forceComplete attribute.
Returns the name of the first session with available results.
Returns the result item at the specified index. The item will be a value of type nsIAutoCompleteItem.
Returns the number of results. (The session argument is currently ignored).
Returns the result value at the specified index. The item will correspond to the text of that item that appears in the popup.
Returns the session object with the given index. This will return an object of type nsIAutoCompleteSession.
Returns the session object with the given name. This will return an object of type nsIAutoCompleteSession.
Returns the result item at the specified index for a specific session.
Returns the result value at the specified index for a specific session.
Gets and sets the value of the hideHistory attribute.
Gets and sets the value of the isSearching attribute.
Gets and sets the value of the isWaiting attribute.
Gets and sets the value of the maxrows attribute.
Gets and sets the value of the noMatch attribute.
Removes a session object from the autocomplete widget. The argument should be an object which implements the nsIAutoCompleteSession interface.
Gets and sets the value of the resultsPopup attribute.
Gets and sets the value of the searchSessions attribute.
Gets and sets the value of the sessionCount attribute.
Gets and sets the value of the showCommentColumn attribute.
Gets and sets the value of the showPopup attribute.
Gets and sets the value of the tabScrolling attribute.
Gets and sets the value of the timeout attribute.
Gets and sets the value of the userAction attribute.