HTML Forms, Radio Buttons

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 
<html>
<body>
<title> Text Field in HTML</title>
<form>
First name:<input type ="text" name ="firstname"><br> Last name:
<input type ="text" name ="lastname">
</form>
</body>
</html>
 OUTPUT:-
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
<html>
<body>
<form>
  <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
</form> 

</body>
</html>
Output

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



 Checkboxes in HTML
Check Box is used when user want to select two or more items see this example
<html>
<body>
<form>
  <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>

</body>
</html> 
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  

4 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Android working framework is produced for the shrewd versatile handset and later on taking after the liberal permitting approach of Google Inc each developer and non software engineer has gone into the invasion to build up their own android application. http://www.mordocrosswords.com/2016/09/cake-mix-direction.html

    ReplyDelete