HTML-Lesson 13
HTML in forms
The form tag
<form method="post" action="mailto:your email address" enctype="text/plain">
This is a pure HTML tag. Alternatively you can have a CGI tag which is something like:-
<form method="post" action="url/cgi-bin/formmail.pl" name="Feedback_Form" onsubmit="return validate();">
<input>
<input>
</form>
You can have as many of the input tags as you need.
Input tags
<input type="text" name="" value="" size="" maxlength="" />
The text type of input is just that. The name should reflect the expected data e.g. "First name", "Last name" or "email address". The size indicates the size of the input box. The text can be shorter or longer than this value. The value displays a default text in the input box. The max length specifies the maximum length of the input text. See this example.
<input type="password" name="" />
The password type of input displays a dot or asterisk for each character entered.
<input type="hidden" name="" value="" />
A hidden type of 'input' allows for items not entered by the user, e.g. 'subject'. It could also be used if a web site carries several almost identical forms to identify which is which.
<textarea name="" rows="" cols="" />
The textarea is type of input in which you specify a box deeper than one line.
Special optional inputs
These inputs are either circular (radio) buttons or square (check) buttons. The difference between these is that for radio buttons, one and one only is checked, while for check buttons any number from zero up to all may be selected.
<input type="radio" name="" value="" checked />
<input type="checkbox" name="" value="yes" />
Note - For Check Boxes the NAME changes and the VALUE stays the same and with Radio Buttons, the VALUE changes but the NAME stays the same.
A pull down list
<select name="">OR
<option value="">
...
<option value="">
</select>
If your user clicks on one of the options, that is the returned value.