Previous | Home | Next |
Html forms are used to take inputs from the user and the pass data to the server.The important element of the form are the input element which is used to select users information. an input element varies in many ways depending upon the type attribute. radio button,submit button, checkbox, password are the various input elements. <form> is a tag which is used to create a html form, syntax for html form
<form> define input elements </form>
Some HTML Tags With Their Description
<form>: This tag defines a HTML form for user input.
<input />: This tag is used to defines an input control ,it creates data entry field on html form
<textarea>: Text area tag is defines a multi-line text input control
<label>: Label tag defines a label for an input element
<fieldset>: Border around elements in a form define by it <legend> defines a caption for a fieldset element
<select>: drop-down list is define by select tag
<optgroup>: This defines a group of related options in a select list
<option>: It defines an option in a select list
<button>: Push button is defined by this tag
Different HTML Forms Input Elements With Example
Text field, password field , radio button, submit button are the input elements of form. These are used to select users information.
TEXT FIELD: defines the one line input field in which the user can enter the data/information
<form> <input type="text"name="First name" />First name <br/> <input type="text"name="Last name" />Lastname </form>
PASSWORD FIELD: this field is used to set the password for the user or user set password itself.
<form> First name:<input type="text"name="First name" /> <br/> Last name:<input type="text"name="Last name" /><br/> Pasword:<input type="password" name="pwd"/><br/> </form>
CHECK BOXES: Check boxes makes it easy for the user to select number of options from multiple options
<form> <input type="checkbox" name="vehicle" value="Bike" /> I like bikes <br /> <input type="checkbox" name="vehicle" value="Car" /> I love car </form
RADIO BUTTON: These button are used to make single choice from number of choices. while filling the form user has to be selected one option out of the more options <form>
<form> <input type="radio" name="sex" value="male" /> Male<br /> <input type="radio" name="sex" value="female" /> Female </form>
SUBMIT BUTTON: Submit button is used to send data from form to the server. in submit button the attribute defines the file name that file is basically needs to do something with the getting input
<form name="input" action="html_form_action.asp" method="get"> Username: <input type="text" name="user" /> <input type="submit" value="Submit" /> </form>
DROP DOWN LIST: Drop down list the input element of html form tag which provide facility to the user just to drop and down the prior mention list of item which are store inside the drop down button.
<html> <body> <form action=""> <select name="year of passing"> <option value="year of passing">year</option> <option value="2008">2008</option> <option value="2009">2009</option> <option value="2010">2010</option> </select> </form> </body> </html>
Previous | Home | Next |