Forms
Forms
An HTML form facilitates the user to enter data that is to be sent to the server for
processing such as name, email address, password, phone number, etc.
Text Box:
<form action="/action_page.php">
<h1>Text Box</h1>
<h2>Login Form</h2>
Username: <input type="text" name="name" value="" maxlength="15"
placeholder="Enter username" pattern="[a-zA-Z]{3}"><br><br>
Password: <input type="password" name="pass" value="" maxlength="9"
placeholder="Enter password" pattern="[0-9]"><br><br>
<input type="submit">
</form>
Radio:
<form>
<h1>Radio Buttons</h1>
<input type="radio" name="gender" value="Male">Male
<input type="radio" name="gender" value="Female">Female
</form>
Checkbox
<form>
<h1>CheckBox</h1>
<h3>Known Languages</h3>
<input type="checkbox" value="Telugu">Telugu
<input type="checkbox" value="English">English
<input type="checkbox" value="Hindi">Hindi
</form>
Textarea
<form>
<h1>Textarea</h1>
<h3>Address</h3>
<textarea rows="5" cols="10">
</textarea>
</form>
Select
<form>
<h1>select</h1>
<select>
<option>--select--</option>
<option>C++</option>
<option>Java</option>
<option>Phython</option>
<option>C</option>
</select>
</form>
Browse
<form action="/action_page.php">
<h1>Browse</h1>
<input type="file" name="file" accept="image/*">
<input type="submit">
</form>
Buttons
<form>
<h1>Button</h1>
<input type="Submit" name="submit" value="Submit">
<input type="Reset" name="reset" value="Reset">
<input type="button" name="button" value="click me"><br><br>
<input type="image" name="imgbtn" src="">
</form>
HTML5 added new types on <input> element. Following is the list of types of
elements of HTML5