0% found this document useful (0 votes)
11 views3 pages

Forms

The document describes different types of HTML form elements including text boxes, radio buttons, checkboxes, textareas, select menus, file uploads, and buttons. It provides code examples for each type of form element and describes their purpose for entering user input like names, selections, text, and files. It also lists new input types added in HTML5 like color, date, email, number, and telephone number fields.

Uploaded by

nsahithin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

Forms

The document describes different types of HTML form elements including text boxes, radio buttons, checkboxes, textareas, select menus, file uploads, and buttons. It provides code examples for each type of form element and describes their purpose for entering user input like names, selections, text, and files. It also lists new input types added in HTML5 like color, date, email, number, and telephone number fields.

Uploaded by

nsahithin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

An HTML form is a section of a document which contains controls such as text fields,

password fields, checkboxes, radio buttons, submit button, menus etc.

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

type=" " Description


color Defines an input field with a specific color.
date Defines an input field for selection of date.
datetime-local Defines an input field for entering a date without time zone.
email Defines an input field for entering an email address.
month Defines a control with month and year, without time zone.
number Defines an input field to enter a number.
url Defines a field for entering URL
week Defines a field to enter the date with week-year, without time zone.
search Defines a single line text field for entering a search string.
tel Defines an input field for entering the telephone number.

You might also like