up

inputs

The <INPUT> tag is used in forms and allows interaction with the httpd server.

There are several types of input tags:


<input NAME=name [value=string] [Type =type] [SIZE=x,y] [checked] ALIGN=align>

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


Plain input field <input [name=name] [value=text] [size=width]>

	<form>
	 <input>
	</form>
	<form>
	 <input value=12345678901234567890 size=40>
	</form>


Text fields

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>


submission buttons
<input Type="submit">

<input Type="submit" value="custom caption">

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.

reset button
Type="reset"


check boxes
Type=checkbox
<input name=check Type="checkbox" value="check">
<input NAME=check value="check2" Type=checkbox checked>
No labels are displayed automatically beside checkboxes or radio boxes.
radio buttons
Type=radio
<input name=radio Type=radio value="radio">
<input NAME=radio value="radio2" Type=radio checked>

uploading a file
Type=file

<input name=file Type=file value="upload">

password box
Type=password

  • <select [MULTIPLE]>...</select>

    This creates a pull-down menu containing Options in a form.

    single select
    	<form>
    	<select NAME="direction">
    	<OPTION SELECTED> North
    	<OPTION> East
    	<OPTION> South
    	<OPTION> West
    	</select>
    </form>
    
    multiple select (use ctrl-click to select)
    	<form>
    	<select NAME="direction" MULTIPLE >
    	<OPTION SELECTED> North
    	<OPTION> East
    	<OPTION> South
    	<OPTION> West
    	</select>
    </form>
    
    produces:

  • <isindex>

    This is probably the strangest tag. When I first saw it, I though that it provided a free text searching capability on a set of documents.

    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.


  • <textarea [rows=rows] [cols=cols]>

    This allows us to put a panel of text in a form

    in Xmosaic, the text is shown within the text area.
  • hidden

    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.

    You cant see hidden fields
    <input type=hidden name=hide1 value="hidden data for field hide1">
    <input type=hidden name=hide2 value="hidden data for field hide2">
    <input type=hidden name=hide3 value="hidden data for field hide3">