.:: Welcome To My Personal Blog ::.

Thursday, April 21, 2011

Web designing - HTML Tutorial - 8

HTML Forms:

Forms in HTML are used with <form> tag. It starts with <form> and ends with </form>. <form> tag has some attributes like "name", "action", "method" etc.

There are several input elements in HTML form. Some of them are text field, password field, radio button, check box, button (submit or reset), drop down list etc.

To send data throw a HTML form, there are two methods - "GET" and "POST". If the GET method is used then the information will be visible to everyone (through the browser address bar). But if the POST method is used to send information then the data will become invisible to others.


Example of Text field:
<form>
      Name1: <input type="text" name="name1" /><br />
      Name2: <input type="text" name="name2" />
</form>
      HTML view of this example:
Name1:
Name2:

Example of Password field:
<form>
        Password: <input type="password" name="pass" />
</form>
      HTML view of this example: 
 Password:

Example of Radio Button:
<form>
        <input type="radio" name="menu" value="menu1" /> menu1<br />
        <input type="radio" name="menu" value="menu2" /> menu2
</form>
      HTML view of this example:
menu1
menu2 
Example of Check Box:
<form>
        <input type="checkbox" name="menu" value="menu1" /> menu1<br />
        <input type="checkbox" name="menu" value="menu2" /> menu2
</form> 
      HTML view of this example: 
menu1
menu2

Example of simple Drop down list:
<form>
<select name="menu">
<option value="first">First</option>
<option value="second">Second</option>
<option value="third">Third</option>
</select>
</form>
      HTML view of this example: 

Example of Button:
    <form name="input" method="get">
    Name: <input type="text" name="name" />
    <input type="submit" value="Submit" />
    </form> 
      HTML view of this example: 
Name:



Help Links:



1 comment:

Popular Posts