The Text Field Widget
Try it out...type in some text.
Behind the scenes, the above text field was created with the following HTML code
<FORM ACTION = ""> <INPUT TYPE = "TEXT" NAME = "demo" > </FORM>
| Attribute | Description |
|---|---|
| TYPE | Specifies the type of interface widget. For a Text Field, you use "TEXT" |
| NAME | Specifies the variable name associated with this widget |
| VALUE | Specifies initial default text that should appear in the text field |
| MAXLENGTH | Specifies the maximum number of characters allowed to be input into the widget |
| SIZE | Specifies the width of the field |
The VALUE attribute
And here is the code that we used to make that text field.
<FORM ACTION = "">
<INPUT TYPE = "TEXT"
NAME = "demo"
VALUE = "default text"
>
</FORM>
The MAXLENGTH attribute
And here is the code that we used to make that text field.
<FORM ACTION = "">
<INPUT TYPE = "TEXT"
NAME = "demo"
MAXLENGTH= "5"
>
</FORM>
The SIZE attribute
And here is the code that we used to make the text fields.
<FORM ACTION = "">
<INPUT TYPE = "TEXT"
NAME = "demo"
SIZE = "30"
>
<INPUT TYPE = "TEXT"
NAME = "demo"
SIZE = "20"
>
</FORM>