CDF - Structuring Web Forms Lesson

 

Structuring Web Forms Lesson

Building Your Web Form

Same Web form ImageThe <form> element is the input container that will be used in your HTML document to build your form. You will also need to use the action and method attributes with the <form> tag in your HTML document. The action attribute is the URL for the form handler. The method attribute is used to determine how you want form data to be sent to the form handler.

The learning object below contains hotspots to detail the type of input fields commonly used on forms. There are other input fields that are also used such as the password, date, and time.

Below are the commonly used form elements:

Type Description
<input type="text"> Displays a single-line text input field
<input type="radio"> Displays a radio button (for selecting one of many choices)
<input type="checkbox"> Displays a checkbox (for selecting zero or more of many choices)
<input type="submit"> Displays a submit button (for submitting the form)
<input type="button"> Displays a clickable button
<label> Defines a label for several form elements.

 

Form Validation

There is a possibility that incorrect data may be entered as individuals enter data into the web form. You can check the data either with local JavaScript or PHP scripts on your server.

 

IMAGES CREATED BY GAVS