HTML - Input Type

The <input> tag is used to indicate where user input is expected.this tag is used to create textbox,password,radio button,checkbox and action button.

Text

The most common value of this attribute of the input tag is text.this attribute is use to create a single line textbox.

Example


<form action="post">
	<inputtype="text"name="username"placeholder="Username">	
</form>						
							

Password

The password it is exactly the same except that for security it display *** instead of the actual input.

Example


<form action="post">
	<inputtype="password"name="password"placeholder="Password">	
</form>							
							

Checkbox

Checkbox display a simple check box that can be checked or left empty; use a check box when the choice is yes or no and doesn't depend on anything else.

Example


<form action="post">
	<inputtype="checkbox"name="Yes"value="Yes">	
</form>						
							

Radio

Radio Button is a more complex version of a check box,allowing only one of a related set to be chosen.you can group radio buttons together by using the name attribute this keeps all buttons in the same group under one name.

Example


<form action="post">
	<inputtype="radio"name="gn"value="Male" checked>	
	<inputtype="radio"name="gn"value="Female">	
</form>							
							

Number

You can also set restrictions on what numbers are accepted.

Example


<form action="post">
	<inputtype="number"name="no"min="1">max="10">
</form>						
							

Submit

Submit display a push button with the preset function of sending the data in the form the server to be processed by a server side script.you can used value attribute with submit to provide text other than submit query for the button.

Example


<form action="post">
	<inputtype="submit"name="submitnow"value="Insert">	
</form>							
							
							

Reset

This button is used to reset form data.

Example


<form action="post">
	<inputtype="reset"name="reset"value="Reset">	
</form>							
							

Button

This type button is simple button not a same submit button.

Example


<form action="post">
	<inputtype="button"name="btn"value="OK">	
</form>							
							
Share Share on Facebook Share on Twitter Share on Google+ Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit