![]() |
The following tags implement the forms interface:
<form> . . . </form>
<input>
<select> . . . </select>
<option>
<textarea> . . . </textarea>
<form> . . . </form> element.
<form> . . . </form>
Define a form within an HTML document.
A document may contain multiple <form> elements, but
<form> elements may not be nested.
Note that non-form tags can be used within a <form> element.
Attributes and their arguments:
action="URL":
method=data_exchange method
get or post.
post is preferred for most applications.
<form action="http://kuhttp.cc.ukans.edu/cgi-bin/register" method=post> . . . </form>
<input> (there is no ending tag)
Defines an input field where the user may enter information on the form.
Each input field assigns a value to a variable which has a specified
name and a specified data type.
Attributes and their arguments:
type="variable_type"
type="text" and type="password" fields
accept character data
type="checkbox" fields are either selected or not
type="radio" fields of the same name allow selection
of only one of the associated values
type="submit" defines an action button that sends
the completed form to the query server
type="reset" defines a button that resets the form
variables to their default values
type="hidden" defines an invisible input field whose value
will be sent along with the other form values when the form is
submitted. This is used to pass state information from one
script or form to another.
name="textstring"
textstring is a symbolic
name (not displayed) identifying the input variable as in:
<input type="checkbox" name="box1">
value="textstring"
textstring
depends on the argument for type.
type="text" or type="password",
textstring is the default value for the
input variable. Password values will not be shown on the
user's form. Anything entered by the user will replace any default value
defined with this attribute.
type="checkbox" or type="radio",
textstring is the value that will be sent to the server
if the checkbox is "checked".
type="reset" or type="submit",
textstring
is a label that will appear on the submit or reset button in place of
the words "submit" and "reset".
checked
type="checkbox"
or type="radio",
if checked is present the input field
is "checked" by default.
size="display_width"
display_width is an integer value
representing the number of
characters displayed for the type="text"
or type="password" input field.
maxlength="string_length"
string_length is the maximum number of characters
allowed within type="text" or type="password"
variable values.
This attribute is only valid for single line "text"
or "password" fields.
<select> . . . </select>
defines and displays a set of optional list items from which the user
can select one or more items.
This element requires an <option> element for each
item in the list.
Attributes and their arguments:
name="textstring"
textstring is the
symbolic identifier for the select field variable.
size="list_length"
list_length is an integer value representing
the number of <option> items that will be
displayed at one time.
multiple
multiple attribute
allows selection of more than one <option> value.
<option>
Within the <select> element the <option>
tags are used to define the possible values for the select
field. If the attribute selected is present then the
option value is selected by default. In the following example
all three options may be chosen but bananas are selected by default.
<select multiple>
<option>Apples
<option selected>Bananas
<option>Cherries
</select>
<textarea> . . . default text . . . </textarea>
Defines a rectangular field where the user may enter text data. If "default text" is present it will be displayed when the field appears. Otherwise the field will be blank. Attributes and their values:
name="textstring"
textstring is a symbolic
name that identifies the <textarea> variable.
rows="num_rows" and cols="numcols"
<textarea>
to be displayed.
| | ||
| HelpNet was created by the 1995 incoming graduate class. It is only occasionally updated. | Department of Computer Science School of Engineering, University of Virginia 151 Engineer's Way, P.O. Box 400740 Charlottesville, Virginia 22904-4740 (434) 982-2200 Fax: (434) 982-2214 | Web Comments: webteam@cs.virginia.edu Admissions Inquiries: inquiry@cs.virginia.edu Site directory, Other addresses Server statistics © Created by the CS Web Team |