Home Advertise with us Forum Articles Sitemap Contact
Logo  

HTML Forms

HTML allows the creation of forms. Form creation enables you to build a dynamic website that is more user-friendly & interactive.

The form area is contained of numerous form elements. These elements serve to enable the user to share information like, name, address, credit card numbers, etc or select out of preset options like, drop-down menus, check boxes, option buttons, etc.

The <form> tag is used to define a form. The most important tag of the form tag is the <input> tag. There are few type attributes that specify the type of input. Common used input types include:
Code Results
Example of Text Fields:

<form>
First name:
<input type="text" name="firstname" />
</form>

Example of Checkboxes:

<form>
My Favorite cartoon:
<input type="checkbox" name="toon" value="Donald" />
</form>

Example of Radio Buttons:

<form>
<input type="radio" name="sex" value="female" /> Female
</form>

Example of Text Fields :
First name:


Example of Checkboxes :
My Favorite cartoon:


Example of Radio Buttons :
Female

The action attribute of the form allows the user to actually submit the form. The name attribute allows setting the label of the button to ‘Send’ or ‘Submit’. The action attribute is used to specify the destination URL where the data is to be sent. This can be better explained through the following example:

Code Results

<form name="input" action ="mailto :mymailid@email.com" method="get">

Username:

<input type="text" name="user" />
<input type="submit" value="Submit" />
</form>

Username:
In the above example, clicking the Submit button causes the browser to send your input to the email ID “mymailid@email.com”.
 

HTML Tip 1

Use only hexadecimal #RGB values for colors. The behavior of named colors is browser-idiosyncratic and totally unpredictable.
 
 

HTML Tip 2

You can resize your images without a graphics program by changing the HEIGHT and WIDTH in your image tag.