Wednesday, July 9, 2008

The <input> tag

The <input> tag is used to create "controls" in a form. There are four types of input controls:
  • text box
  • submit button
  • radio buttons
  • checkboxes

You choose the type of control using the type attribute. Also, every input control must have a name attribute. The name attribute's value is a text string. It's a good idea to avoid special characters (except the underscore). It can contain letters and numbers, but should not having a leading number.
Note that violation of the above rules does not give validation errors.
The name given to a form control is associated with the data sent by that control to the server. (Eg. If the method is get, the url sent to the application will be something like http://www.somesite.com/processorder.php?fieldname=sometext )

No comments: