Designer at work

The <form> tag

The form tag <div> lets you design an electronic form in a web page.

Any other tags can be placed inside the form tags.

Some elements are specific to a form and include:

text input box

<p>Name: <input type="text" value="Type your name" name="yourName" size="30" /></p>

displays as:

Name:

checkbox

<p>Which do you like:<br />
<input type="checkbox" value="icecream" name="like" /> Ice cream<br />
<input type="checkbox" value="jelly" name="like" /> Jelly</p>

Displays as:

Which do you like:
Ice cream
Jelly

Note that with checkboxes you can choose all options.

radio buttons

<p>Which do you prefer:<br />
<input type="radio" value="icecream" name="pref" /> Ice cream<br />
<input type="radio" value="jelly" name="pref" /> Jelly</p>

Displays as:

Which do you prefer:
Ice cream
Jelly

Note that with radio buttons you can choose only one option.

menu list

<p>Choose one:
  <select name="season">
    <option>Summer</option>
    <option>Autumn</option>
    <option>Winter</option>
    <option>Spring</option>
  </select>
</p>

Displays as:

Choose one:

textarea

<p>Comments:<br /> 
<textarea cols="50" rows="5" name="Comments">
Write your comments here
</textarea>
</p>

displays as:

Comments:

submit button

<p><input type="submit" 
    value="Send the information now ... " 
    name="submit" /></p>

Displays as:

The attributes