|
|
The Text Field Widget
The Text Field Widget
- The most common interface widget is the
Text Field. A Text Field allows a user to type in a line of text and looks like the
following:
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>
- Notice that the Text Field widget is
specified as an input TYPE of "TEXT". Also notice that if you
hit return after typing in some text, you will be returned to this
page. This is because we have not specified an ACTION in the
FORM tag. I did this so you can focus on the widget instead of
a CGI script.
- The Text Field also has several other
attributes that affect how it works. The following table outlines
them:
| 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 |
- Let's take a closer look at each of these attributes.
The VALUE attribute
The MAXLENGTH attribute
The SIZE attribute
The <Input> Tag
Table of Contents
The Password Widget
|
|