Friday, 15 April 2016

HTML Forms

HTML Forms And Input

HTML Forms are used to different kinds of user input

Form elements that allow the user to enter Information like text fields, text are fields,drop down menus, radio buttons, check boxes etc in a form.

A form is defined as <form>  in HTML and closed at </form>
<input> element is most important in forms and close it </input>
The most important example of < input> type below 
<title> tag is used for Title of the program try it I explained this example.
Mainly Text field is used when user want to type letters, number etc.
Text Field in HTML 
<title> Text Field in HTML</title>
First name:<input type ="text" name ="firstname"><br> Last name:
<input type ="text" name ="lastname">
First name:
Last name:
Note:- The form itself is visible. Also note that the default width of text field is 20 characters
In this example i use break tag mean <br> tag is used for break the line mean using <br> i write in same line but output show in next line.

Radio Button in HTML
Radio Button are used when the user select any one limited number of choices and also note that only one option you have choose in 

Radio Buttons See this example
  <input type="radio" name="gender" value="male" checked> Male<br>
  <input type="radio" name="gender" value="female"> Female<br>
  <input type="radio" name="gender" value="baby"> Baby


Note:- this example you also write in simple words try it This is also correct
  <input type="radio" > Male<br>
  <input type="radio" >Female<br>
  <input type="radio"> Baby

 Checkboxes in HTML
Check Box is used when user want to select two or more items see this example
  <input type="checkbox" name="vehicle" value="Bike"> I have a bike<br>
  <input type="checkbox" name="vehicle" value="Car" checked> I have a car<br>
<input type="checkbox" name="vehicle" value="Cycle"> I have a cycle<br>
  <input type="checkbox" name="vehicle" value="Auto" checked> I have a auto</form>

I have a bike
I have a car
I have a cycle
I have a auto
Note:- You also learn C, C++ tutorial this Link Please click this link for C, C++ Tutorial & InterView Questions
You Like my posts Please share with friends
Previous page
Description, Nested list in HTML  

No comments:

Post a Comment