| CMSC 498P | February 13, 1996 |
III.B. The INPUT sub-element
The INPUT element is a sub-element of the FORM element, and will not do much of anything if used outside of the FORM container tag. The INPUT element represents a user input field and always takes the following form:
<FORM ACTION="someURL" METHOD=POST>
<INPUT NAME="somename1" TYPE="sometype1" ATTRIB ATTRIB>
<INPUT NAME="somename2" TYPE="sometype2" ATTRIB ATTRIB>
</FORM>
The INPUT element always takes a NAME and a TYPE attribute. The name must be a unique name that will be used to identify it's entered value by the server side script mentioned in the FORM's ACTION attribute. The type specifies what type of input method is to be used and comes in 8 varieties: TEXT, PASSWORD, HIDDEN, CHECKBOX, RADIO, RESET, SUBMIT, and IMAGE.
Each type has certain attributes associated with it. The valid type attributes (not all attributes are valid with every type) are:
Following is a summary of each type's attributes (left side of table) alongside a brief snippet of code (left top of table) and the rendered version of the same code (right top of table).
|
|||||
Attributes:
|
<INPUT NAME="name" TYPE="text" SIZE=30 MAXLENGTH=25> <INPUT NAME="email" TYPE="text" SIZE=30 VALUE="EMail here"> |
||||
|
|||||
Attributes:
|
<INPUT NAME="name" TYPE="password" SIZE=30 MAXLENGTH=25> <INPUT NAME="pwd" TYPE="password" SIZE=30 VALUE="Password here"> |
||||
|
|||||
Attributes:
|
<INPUT NAME="name" TYPE="hidden" VALUE="You shouldn't see this!"> <INPUT NAME="pwd" TYPE="hidden" VALUE="Or this..."> |
||||
|
|||||
Attributes:
|
What answer do you like (check all that apply 8^>)? <INPUT NAME="yes" TYPE="checkbox" VALUE="yes" CHECKED> Yes! <INPUT NAME="no" TYPE="checkbox" VALUE="no"> No! |
||||
|
|||||
Attributes:
|
What answer do you like (try to check all that apply 8^>)? <INPUT NAME="maybe" TYPE="radio" VALUE="yes" CHECKED> Yes! <INPUT NAME="maybe" TYPE="radio" VALUE="no"> No! |
||||
|
|||||
Attributes:
|
<INPUT NAME="erase" TYPE="text" VALUE="Type something"> <INPUT TYPE="reset"> <INPUT TYPE="reset" VALUE="Click me!"> |
||||
|
|||||
Attributes:
|
<INPUT NAME="entry" TYPE="text" MAXLENGTH=20 VALUE="Type something"> <INPUT NAME="bold" TYPE="submit"> <INPUT NAME="italics" TYPE="submit" VALUE="Click me for italics!"> |
||||
|
|||||
Attributes:
|
To be implemented soon... |
||||
|
To be implemented soon... |
|||||