Form tag:
Using form tag, we can get input values from the user by allowing them to submit the form. Form tag may optionally contain the following elements.
Using form tag, we can get input values from the user by allowing them to submit the form. Form tag may optionally contain the following elements.
- <input>
- <select>
- <option>
- <optgroup>
- <textarea>
- <button>
- <fieldset>
- <label>
Simple registration form using form element without validation:
<html>
<head>
<title>The Student Registration Form</title>
</head>
<body bgcolor=aqua>
<center><h3>Registration Form</h3></center>
<form name=my_form onsubmit=validate()>
<strong>Name:       
</strong>
<input type=text name=name><br/>
<br>
<br>
<strong>Age:           </strong>
<input type=text name=Age_txt><br/>
<br>
<br>
<strong>Phone No: </strong>
<input type=text name=ph_txt><br/>
<br>
<Br>
<strong>Gender:        </strong>
<input type="radio" name="group1" value="Male">Male    
<input type="radio" name="group1" value="Female">Female<br/><br/><br/>
<strong>Hobby: </strong>
  
<input type="checkbox" name ="option1" value="Singing">Singing<br/>
             
<input type="checkbox" name ="option1" value="Reading">Reading<br/>
             
<input type="checkbox" name ="option1" value="T.V.">Watching T.V<br/>
<br/><br/>
<strong>Country:</strong>
<select name="My_Menu">
<option value="India">India</option>
<option value="China">China</option>
<option value="Shrilanka">Shrilanka</option>
</select>
<center>
<input type=submit value=Submit></br>
</center>
</body>
</html>
Sample output:
No comments:
Post a Comment