Programming for the linux desktop

A form is contained within the HTML tags:
<FORM NAME="form1" ACTION="form_processing.php3" METHOD=GET>
...
</FORM>
 

Form parameters:

NAMEUnique name used to refer to form
ACTIONPage which will process form
e.g. mailto:email@address
or "directory/myfile.php"
METHODGET - gets a page, passing the form data as parameters
POST - sends the form's data

Designing the layout of the form

Text boxes

<INPUT type="text" name="textbox1" SIZE=30>

The standard text input box.

<TEXTAREA name="textarea1" rows=4 cols=30>
Default text
</TEXTAREA>

Text areas allow you to edit larger amounts of text, such as emails or comment boxes

<INPUT type="password" name="password1" SIZE=30>

Password boxes hide any text the user types in, and don't allow cutting or pasting of text

Option (radio) buttons

<SELECT NAME="selection1">
<OPTION VALUE="Red" SELECTED> Red
<OPTION VALUE="Blue">         Blue
<OPTION VALUE="Green">        Green
<OPTION VALUE="Black">        Black
</SELECT>

Select a color: 

Check boxes

<INPUT type="checkbox" name="checkbox1">Widget
<INPUT type="checkbox" name="checkbox2">Grommet
<INPUT type="checkbox" name="checkbox3">Thingy
<INPUT type="checkbox" name="checkbox4">Whatsit

Widget Grommet Thingy Whatsit

Buttons

Submit buttons send the form to the address in the form's METHOD parameter
<INPUT TYPE="submit" VALUE="submit form">

Standad buttons perform user-defined actions, such as the JavaScript code in this example:
<INPUT TYPE="button" VALUE="Click here" onClick="alert('clicked button')">

Reset buttons reset all data in the form
<INPUT TYPE="reset" VALUE="reset form">

Next topic: processing the form

(Valid HTML 4.01)