CGI Forms   «Prev 

Perl Device List

widgets list

All of the widgets use the NAME attribute for the name of the field. This is the name that is passed as the left side of the name=value pair that is sent to the server.

The only widgets with a different behavior for the NAME attribute are RADIO and IMAGE, so there is a description of that unique behavior for those widgets. Otherwise, we will omit the description of the NAME attribute for each widget.

<INPUT TYPE=TEXT> 
<INPUT TYPE=PASSWORD>

The TEXT and PASSWORD fields operate exactly the same, with the exception that the PASSWORD field has its display obscured. The attributes supported are:

SIZE The width of the field in characters
MAXLENGTH The maximum number of characters allowed in the field
VALUE A default value for the text field. This also works for PASSWORD, but it seems kind of silly.

PASSWORD field

The PASSWORD field works exactly the same as the TEXT field. It sends its value to the server in the clear. It should not be used for sending sensitive information (like passwords, for instance).
The PASSWORD field is fine for validating a user profile for a nonsensitive application like Personalized Yahoo for example, but it is not secure enough for protecting important data.

<INPUT TYPE=CHECKBOX>

The CHECKBOX widget is an on/off selector. It is usually rendered as a small box that can be checked or blank.
The name/value pair will be either name=on or name=value, if the VALUE attribute is used. These are the attributes for the CHECKBOX widget:

VALUE The value that will be sent if the box is checked.
CHECKED If present, this makes the default state checked.

<INPUT TYPE=RADIO>
Radio widgets are like grouped check boxes. Each radio button can be either on or off, but only one radio button in a group can be on at a time. A group of radio buttons are defined by giving them all the same NAME. Each radio button in a group should have a different VALUE so that you can distinguish which one is checked.

NAME The name of the group this radio button belongs to
VALUE The value that will be sent if the button is checked
CHECKED If present, this is the default button. Only one button in a group should have this attribute.

<INPUT TYPE=SUBMIT>

This widget is the submit button for the form. A form may have more than one submit button. You will be able to determine which one was clicked by giving them different names.
VALUE Used to set the text that is displayed in the button

<INPUT TYPE=RESET>

The RESET widget is a button that resets the form. It does not generate a name/value pair.
VALUE Used to set the text that is displayed in the button

<INPUT TYPE=HIDDEN>
The HIDDEN field is used for sending informational data to the server. It is not displayed, but its name/value pair gets sent to the server along with the form. This is commonly used for maintaining context (we'll use this later in this module).

VALUE The value sent with the name/value pair
<INPUT TYPE=IMAGE>
This is a graphical version of the SUBMIT widget. It is commonly used for creating graphical buttons. When you click the image, it submits the form along with the coordinates of where the image was clicked. This widget generates two name/value pairs like this:

name.x=35
name.y=42

NAME The name for the name/value pairs. Note the description above for this widget's unique behavior.
SRC The URL of the image to display
WIDTH The width of the image
HEIGHT The height of the image
BORDER Defaults to having a border. Use BORDER=0 to turn it off.
VALUE There is no VALUE attribute for this widget!

<SELECT> 
</SELECT>

A widget that displays multiple choices, like a dropdown box or a selection box.
This element is an HTML container, so it requires an end tag. Within the container, each selection option is indicated with an <OPTION> tag. For example:

<SELECT NAME="parts" SIZE=4 MULTIPLE>
  <OPTION> Strings
  <OPTION SELECTED> Pickups
  <OPTION> Bridge
  <OPTION> Neck
  <OPTION> Frets
  <OPTION> Tuning machines
</SELECT>

Use the SELECTED attribute in the OPTION tag to indicate default selections.
SIZE The number of options displayed at once. Omit this for a drop-style box on some systems.
MULTIPLE Include this attribute to allow multiple selections.

<TEXTAREA>
</TEXTAREA>

A free-form text-entry area. Note that the WRAP attribute is a common Netscape extension.

ROWS The height of the widget's display area in lines of text
COLS The width of the widget's display area in columns of characters
WRAP These are possible values:
HARD enables word wrap and passes the line breaks to the server.
SOFT enables word wrap and does not pass the line breaks to the server.
OFF disables word wrap.