HTML Forms

HTML forms are areas which contain form characters.


What is Form Fields?

Form Fields can be defined as characters which permit the user to enter data in the forms. Examples of Form Fields are textarea, textfields, drop-down menus, checkboxes, etc. 

HTML Forms are defined with form tags : <form>


<form>
    <input>
    <input>
</form>


The Input Tag:

The <input> tag is the most used form tag. The type attribute within the input tag defines the type of input. Examples of the commonly used types are given below:

 


Text Fields:

Text fields are areas where you are supposed to type. However, it should be kept in mind that the form is not visible in the browser. Most of the browsers have a width of 20 characters by default.


An example of Text Field and its appearance in the browser is given below:


<form>
First name:
<input type=“text” name=“email adress”>
<br>
Last name:
<input type=“text” name=“password”>
</form>


This would appear in the browser as:


Email address:  
Password:        




Checkboxes:

Checkboxes are commonly used for giving someone choices.



 


 

<form>
My school is good:
<input type=“checkbox” name=“school” value=“good” />
<br />
My school is bad:
<inout type=“checkbox” name=“school” value=“bad” />
</form>

 
It would appear in the browser as:




My school is good: 















My school is bad:   




Radio buttons:



Radio buttons are like Checkboxes. They are also used when you need to give specific choices to the user. An example is shown below:



<form>
<input type=“radio” name= “meat” value=“chicken”> Chicken
<br>
<input type=“radio” name= “meat” value=“beef”> Beef
 



In the browser it would appear as:




Chicken
Beef




 







 

                    

Copyright © 2008 VisualBuilder. All rights reserved