HTML-Lesson 14

Forms 2

A scrolling list

The 'size' attribute shows how deep is the displayed portion of the list.
<select name="" size="">
The 'selected' attribute on one of the options shows the default choice.
<option value="" selected />
</select>

Form buttons

<input type="submit" value="" />
<input type="reset" value="" />

The 'submit' button sends the form off to you. The 'reset' button clears the form should the user change their mind. The value is the text that appears on the button.

A form to send you a file from your user

<form enctype="multipart/form-data">
<input type="file" name="myfile" />
</form>

A button to take your user to another page

<form action="URL OF ANOTHER PAGE">
<input type="submit" value="
NAME OF THE OTHER PAGE" />
</form>

Click here for another example page.

Validation of received form data

One cause of concern to web authors is the accuracy of the data that they receive. There seems to be no absolute method of validation. However, there are javascript's which check that the data is plausible. E.G. an entered email address is in the right form. One possible approach is to ask that sensitive data is repeated.

One validation technique that is becoming more common is to ask the user to copy the characters displayed in a graphic. This is supposed to ensure that the user is a human and not a robotic program!

Table

This could be one of the exceptions that proves the rule. Using a table can make the form look a lot more tidy. See this example.

Previous Lesson previous lesson next lesson Next Lesson