programplug Logo




HTML Form

HTML Form is used when you want to grab some data from the site of vistor.for example during the application form you would like to look the information such as name, date of birth, email etc. HTML forms contain a special elements like checkboxes,radio-buttons,submit buttons etc. Users generally complete a form by its controls e.g. filling the text,selcting the items, etc.and then submit the form to a web sever where it is processing.

HTML Forms

Your First Name:

Your Last Name:


if you click on "Submit" button, the data will sent into action page.

Text Input


<input type="text"> It defines a one-line input field: Example:
<!DOCTYPE html>
<html>
<body>

<h4>Text Input</h4>

<form>
  Fname:<br>
 <input type="text" name="Fname">
  <br>
  Lname:<br>
  <input type="text" name="Lname">
</form>

<p>Make sure that the form itself is not visible.</p>

<p>Remember the width of a text is 20 characters.</p>

</body>
</html>
	  
OUTPUT:

Text Input

Fname:

Lname:

Make sure that the form itself is not visible.

Remember the width of a text is 20 characters.

Checkbox Control
Checkbox control is used when you want more than one option to be selected.It is also created by <input> tag.

EXAMPLE:
<!DOCTYPE html>
<html>
<head>
    <title>Checkbox</title>
   </head>
	
   <body>
     <form>
         <input type = "checkbox" name = "b.tech" value = "on"> b.tech
         <input type = "checkbox" name = "m.tech" value = "on"> m.tech
         <input type = "checkbox" name = "bca" value = "on"> bca
         <input type = "checkbox" name = "mca" value = "on"> mca
      </form>
   </body>
	
</html>
OUTPUT:
Maths
Physics
bca
mca

Radio Button Control:
The radio button is used to select one choice from different choices.

<!DOCTYPE html>
<html>
<head>
    <title>Radio button Usage</title>
</head>
  <body>
  <form>
<input  type="radio" name="gender" id="male">
<label for="male">Male</label>
<input type="radio" name="gender" id="female">
<label for="female">Female</label>
<input type="radio" name="gender" id="female">
<label for="others">Other</label>
 </form>
 </body>
</html>
                          
	 
OUTPUT:




HTML Form Example

<!DOCTYPE html>
<html>
<head>
<form action=""> 
<table>  
<tr> 
    <td class="tdLabel"><label for="r_name" class="label">Type a name:</label></td> 
    <td><input type="text" name="name" value="" id="r_name" style="width:150px"/></td> 
</tr> 
<tr> 
    <td class="tdLabel"><label for="r_password" class="label">Type a password:</label></td> 
    <td><input type="text" name="name" value="" id="r_password" style="width:150px"/></td> 
</tr> 
<tr> 
    <td class="tdLabel"><label for="r_email" class="label">Type email:</label></td> 
    <td><input type="email" name="email" value="" id="r_email" style="width:150px"/></td> 
</tr> 
<tr> 
    <td class="tdLabel"><label for="r_gender" class="label">Gender:</label></td> 
    <td>
</tr> 
 
<input  type="radio" name="gender" id="male">
<label for="male">Male</label>
<input type="radio" name="gender" id="female">
<label for="female">Female</label>
<input type="radio" name="gender" id="female">
<label for="others">Other</label>
    <td>
</tr> 
<tr>   
     <td class="tdLabel"> <label for="r_game" class="label">Select Game:</label> </td> 
    <td><select name="country" id="r_game" style="width:150px">  
    <option value="Cricket">Cricket </option>
    <option value="Football">Footer </option>  
    <option value="Basketball">Basketball </option>  
    <option value="Hockey">Hockey </option>  
    <option value="Squash">Squash </option>  
    
</select>  
<td>
</tr>   
<tr>   
    <td colspan="3"><div align="center"><input type="submit" id="r_0" value="reg"/>  
</div> </td> 
</tr> 
</table>
</form>
 </body>
</html>
                  
 
Output:

Form Tags

form It defines an HTML form form the end of user.
input It work in input control
textarea It describe a multiline input control.
select It define a drop down list.
ul It describe as a unordered list.
option It represent an option that have a drop-down list
optgroup It deals with a group of related options in a drop-down list.
button It provide a clickable button
label It describe a label for an <input> element
fieldset It is a group of related elements in a form
legend It describe a caption for a <fieldset< element







Our Services

Developing Cheapest Websites
Offer Digital Marketing
Provide College Projects
Attractive Website Developing
Summer Training,Industrial Training
SCO,SMO

Contact Us

Dehradun Uttarakhand India
www.programplug.com
info@programplug.com
08534019974
Designed By : Mridul Gupta

Other Link

About Us

Contact Us

Disclaimer

Privacy Policy