>

HTML TYPE = TEXT

TEXT creates a text entry field (the most popular type of data entry field):

This Code Makes This
<FORM ACTION="/cgi-bin/mycgi.pl">
name: <INPUT TYPE=TEXT NAME="realname">
<P><INPUT TYPE=SUBMIT VALUE="submit">
</FORM>
name:

(Form is not live)

TEXT is the default input type (if you want a text field, you don't even need to use the TYPE attribute).

This Code Makes This
<FORM ACTION="/cgi-bin/mycgi.pl">
<!-- note absence of TYPE attribute -->
name: <INPUT NAME="realname">
<P><INPUT TYPE=SUBMIT VALUE="submit">
</FORM>
name:

(Form is not live)

The behavior of TEXT fields can be modified using these attributes:

  • VALUE: set an initial value for the field
  • SIZE: how wide the field should be
  • MAXLENGTH: the maximum number of characters the user can enter

TYPE=CHECKBOX