0% found this document useful (0 votes)
20 views7 pages

Hyper Text Markup Language Forms

table

Uploaded by

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

Hyper Text Markup Language Forms

table

Uploaded by

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

HTML Forms

HTML Forms use the <form> tag to collect user input through various
interactive controls. These controls range from text fields, numeric
inputs, and email fields to password fields, checkboxes, radio buttons,
and submit buttons.
Syntax:
<form> <!--form elements--> </form>

Table of Content
• Form Elements
• Commonly Used Input Types in HTML Forms
• HTML Forms Example
• Basic HTML Forms
• Advance HTML Forms
Elements Descriptions
<label> It defines labels for <form> elements.

It is used to get input data from the form in various types such
<input>
as text, password, email, etc by changing its type.

It defines a clickable button to control other elements or


<button>
execute a functionality.

<select> It is used to create a drop-down list.

<textarea> It is used to get input long text content.

It is used to draw a box around other form elements and


<fieldset>
group the related data.

<legend> It defines a caption for fieldset elements

<datalist> It is used to specify pre-defined list options for input controls.

<output> It displays the output of performed calculations.

<option> It is used to define options in a drop-down list.

<optgroup> It is used to define group-related options in a drop-down list.


• <!DOCTYPE html>
• <html lang="en">

• <head>
• <title>Html Forms</title>
• </head>

• <body>
• <h2>HTML Forms</h2>
• <form>
• <label for="username">Username:</label><br>
• <input type="text" id="username" name="username"><br><br>

• <label for="password">Password:</label><br>
• <input type="password" id="password" name="password"><br><br>

• <input type="submit" value="Submit">


• </form>
• </body>

• </html>
Output:
Input Type Description
<input type=”text”> Defines a one-line text input field

<input type=”password”> Defines a password field

<input type=”submit”> Defines a submit button

<input type=”reset”> Defines a reset button

<input type=”radio”> Defines a radio button

<input type=”email”> Validates that the input is a valid email address.

Allows the user to enter a number. You can specify min, max, and
<input type=”number”> step attributes for range.

<input type=”checkbox”> Used for checkboxes where the user can select multiple options.

<input type=”date”> Allows the user to select a date from a calendar.

<input type=”time”> Allows the user to select a time.

<input type=”file”> Allows the user to select a file to upload

You might also like