
There are several types of input tags:
Creates an input field in a form. NAME must be present for all types of input except submit and reset
TYPE can be one of
<input [name=name] [value=text] [size=width]>
<form> <input> </form> |
|
<form> <input value=12345678901234567890 size=40> </form> |
certain browsers permit the ROW attribute on a text input. In these cases, textareas should be used.
| Incorrect | <input rows=5 cols=30> |
|
|---|---|---|
| Correct | <TEXTAREA ROWS=5 COLS=30 ALIGN=middle> |
|
|
The caption on the button is controlled using
the value parameter.
|
| When the submit button is pressed, the contents of the form are sent to the cgi-script specified in the action parameter of the form. The browser will only send the content of input fields whose name parameter has been set. The name value on the submit button can be used by the cgi script to determine what action to take. In this way one cgi script can be used to process many different forms. |
<form> <select NAME="direction"> <OPTION SELECTED> North <OPTION> East <OPTION> South <OPTION> West </select> </form>
<form> <select NAME="direction" MULTIPLE > <OPTION SELECTED> North <OPTION> East <OPTION> South <OPTION> West </select> </form>produces:
What it actually does is to provide a ready built form (standardization and all that), all you have to do is provide the processing at the server end.
cgi scripts generate dynamic html documents. Often there may be a sequence of forms that are generted and processed by the same script. The script is not given any information about the user and each time a form is submitted there is no way to know what that user has done to get to that stage.
Hidden fields are used by the script to encode state informtion into dynamic documents. When the submit button is pressed, the normal contents of the form plus any hidden information is sent to the script.