HTML Code for Online Forms
The HTML code for your online forms will contain form elements that will enable the end user to enter the required information online. These form elements can include text boxes such as a text area or text fields. Alternatively the information entered by the end user can be controlled by including radio-buttons, drop-down menus and checkboxes. All these form elements can easily be included in your online forms via proper HTML code.
To create a form in an HTML document the <form> tag is used. The form elements are defined with the <input> tag. The latter tag defines the type of input to be used in the form by including the type attribute code for the specific input.
Some examples of input types are the following:
In online forms, text fields are used when the user is required to type his or her name or telephone numbers. In other words these text fields are not limited to a number of replies.
To insert a text field in a form the following code is used:
First name: <input><br />
Initial: <input><br />
Last name: <input>
Radio buttons are used when the end user is required to select one choice from a specified list.
To insert a list with radio buttons used the following code:
<input value="20-29"> 20-29 <br />
<input value="30-35"> 30-35 <br />
<input value="36-40"> 36-40
Check boxes are similar to radio buttons; however with check boxes can select more than one item from the specified list.
Weekdays <input value="Weekdays" /><br />
Saturday <input value="Saturday" /><br />
Sunday <input value="Sunday" />