contents.gifindex.gifprev1.gifnext1.gif

pueblo00000000.gif <form>...</form>

The Form element is used to delimit a data input form. There can be several forms in a single document, but the Form element can't be nested.

The fields of the form are defined by one or more <input> elements. Each <input> element defines a single field which may be edited by the user.

The submitted contents of the form logically consist of name/value pairs. The names are usually equal to the NAME attributes of the various interactive elements in the form.

Note: The names are not guaranteed to be unique keys, nor are the names of form elements required to be distinct. The values encode the user's input to the corresponding interactive elements. Elements capable of displaying a textual or numerical value will return a name/value pair even when they receive no explicit user input.

Attributes

ACTION

The ACTION attribute is a URL specifying the location to which the contents of the form is submitted to elicit a response. If the ACTION attribute is missing, the URL of the document itself is assumed. The way data is submitted varies with the access protocol of the URL, and with the values of the METHOD and ENCTYPE attributes.

If both method=xch_cmd and the MD5 value are specified, then this attribute may be specified to override the command sent to the world when the form is submitted.

METHOD

This attribute selects variations of the protocol. The value may be get, post, or xch_cmd. By default, METHOD=get is used, though for many applications, the post method may be preferred.

method=xch_cmd is a Pueblo enhancement that sends the form data to the world server. For more detailed information on how this method works together with the ACTION attribute and the MD5 attribute, see the document Creating and using HTML dialogs.

ENCTYPE

When METHOD=post, the ENCTYPE attribute is a MIME type specifying the format of the posted data; by default, the ENCTYPE is application/x-www-form-urlencoded.

MD5

This attribute specifies the MD5 value for this user. The MD5 value is passed to the world server through the PUEBLOCLIENT command.

This attribute is used only when method=xch_cmd is specified.

Examples

The following example defines a form:

<form method=post action="http://www.chaco.com/htbin-post/myscript">

<p>Please answer the following questions:

<ol>

<li>Name: <input type=text size=40 name=Name>

<li>How did you hear about our product? (check all that apply):<br>

<input type=checkbox name=Source value=Newspaper>Newspaper

<input type=checkbox name=Source value=Radio>Radio

<input type=checkbox name=Source value=TV>TV

<input type=checkbox name=Source value=Person>Friend/colleague

<li>How many would you like to order? <input type="number" name="Quantity" size=4 value=1>

<input type=radio name=CC value=Visa checked>Visa

<input type=radio name=CC value=Mastercard>Mastercard

<li>Number: <input type=number name=CCNum size=16>

and expiration date (mm/yy): <input type=text name=Expiration size=5>

</ol>

<input type=submit value=" Send this form ">

<input type=reset value=" Reset all values and start over ">

</p>

</form>

Also see

Pueblo Enhancers Guide

<input>

<option>

<select>

<textarea>