XUL Programmer's Reference Manual

<textfield>

Attributes Common Children
value  
id  
class  
multiline  
width  
flex  
maxlength  
read-only  
observes  

The <textfield> element is a text input box not unlike the html <textarea> element. The default <textfield> element has a single line, but the multiline attribute makes it into larger, multiline text area.

<textfield value="Fill in here" />
<textfield 
  value="I am a textarea now" 
  multiline="true"/>

 

value
Description
value is the main attribute for adding text to textfield widgets. 
Syntax
<textfield value="string" />
Example
<textfield value="drink me" />
...
Notes

None.

 
 
 
multiline
Description
multiline turns the <textfield> from a single line textfield into a textarea.
Syntax
<textfield multiline="true | false" />
Example
<textfield multiline="true" value="lots of text" />
...
Notes

When multiline is set to true, the textfield sizes to accomodate the text, but you can use the width, and maxlength attributes to delimit this.

 
 
 
maxlength
Description
maxlength specifies how long the text is before it wraps in the textfield.
Syntax
<textfield maxlength="length in characters" />
Example
<textfield maxlength="30" value="lots and lots and lots and lots of text" />
...
Notes

When the text in a textfield takes up more space than is given by the size, the textfield uses a scrollbar for the overflow.

 
 
 
read-only
Description
read-only indicates that the value of the textfield cannot be edited.
Syntax
<textfield read-only="true | false" />
Example
<textfield read-only="true" value="futile to edit me" />
...
Notes

None.

 
 
 

 
Last updated: 1/3/01 Ian Oeschger