Mozilla XUL Element and Script Reference

Contents  Quick Reference

Textfield

A text input field in which the user can enter text. It is similar to the HTML input element. Only one line of text is displayed by default. The multiline attribute can be specified to display a field with multiple rows.

Attributes:

Attributes inherited from XUL Element


accesskey

This should be set to a letter that is used as a shortcut key. This letter should be one of the characters that appears in the label text for the textfield. This letter will typically be drawn underlined, although this behavior will be platform and skin specific. When the user presses ALT (or a similar key that varies on each platform) and the access key, the textfield will be activated from anywhere in the window.

disabled

If this attribute is set to true, the textfield is disabled. This is usually drawn with the text in grey. If the textfield is disabled, the function of the button cannot be performed. The value may also be set to false for a regular active button. If this attribute is left out entirely, the button is enabled.

left

For elements placed within a bulletinboard, specifies the position of the left edge of the textfield.

maxlength

The maximum number of characters that the textfield allows to be entered.

multiline

If true, the textfield displays multiple lines. If the user presses ENTER, a new line is started. If false, the textfield only allows entry of one line.

readonly

If set to true, then the user cannot modify the value of the textfield. However, the value may still be modified by a script.

size

top

For elements placed within a bulletinboard, specifies the position of the top edge of the textfield.

type

You can set this attribute to the special value password to create a textfield that hides what it types. This is usually used for password entry fields. Use text for regular textfields.

value

The label that will appear on the textfield. If this is left out, no text appears.