SlideShare a Scribd company logo
1By ShreyaChougule
The <form> Element
The HTML <form> element defines a form that is used to
collect user input
An HTML form contains different form elements.
Form elements are types of input elements, like text fields,
checkboxes, radio buttons, submit buttons, and more.
Syntax of form is given by:-
<form>
.
form elements(different input elements)
.
</form>
2By ShreyaChougule
Use of The <input> Element
The <input> element is one of the most important form element.
The <input> element can be displayed in several ways, depending on
the type attribute.
Some of the types of input elements are as follows:-
Type Description
<input type=“text”> Gives one line text input
<input type=“radio”> Used for selecting one of the many
choices
<input type=“submit”> Used for submitting form
3By ShreyaChougule
Action Attribute
The action attribute defines the action to be
performed when the form is submitted.
Normally, the form data is sent to a web page on the
server when the user clicks on the submit button.
If the action attribute is omitted, the action is set to
the current page
4By ShreyaChougule
Target Attribute
The target attribute specifies if the submitted result
will open in a new browser tab, or in the current
window.
The default value is "_self" which means the form
will be submitted in the current window.
To make the form result open in a new browser tab,
use the value "_blank":
<form action="/action_page.php" target="_blank">
5By ShreyaChougule
Method Attribute
The method attribute specifies the HTTP method
(GET or POST) to be used when submitting the form
data.
Get is used to request data from specified resource.
Post is used to send data to server to create or update
resource.
Get method:-It gives content of form in web address
<form action="/action_page.php" method="get">
Post method:-It does not give any content.
<form action="/action_page.php" method=“post">
6By ShreyaChougule
Use of get method
The default method when submitting form data is GET.
However, when GET is used, the submitted form data will
be visible in the page address field:
/action_page.php?firstname=Mickey&lastname=Mouse
Appends form-data into the URL in name/value pairs
The length of a URL is limited (about 3000 characters)
Never use GET to send sensitive data! (will be visible in
the URL)
GET is better for non-secure data, like query strings in
Google
7By ShreyaChougule
Use of Post Method
Always use POST if the form data contains sensitive
or personal information. The POST method does not
display the submitted form data in the page address
field.
POST has no size limitations, and can be used to send
large amounts of data.
8By ShreyaChougule
Name Attribute
Each input field must have a name attribute to be
submitted.
If the name attribute is omitted, the data of that
input field will not be sent at all.
If we use get method then the omitted name will not
be visible at web address bar.
Syntax:-
<input type="text" name="lastname" value="Mouse">
OUTPUT
9By ShreyaChougule
Grouping Form data
Generally in order to group certain set of data in the
form <fieldset> tag is used.
The <legend> element defines a caption for
the <fieldset> element.
Syntax:-<form action=“”>
<fieldset>
<legend>Heading you want to display</legend>
<label for=“”>
<input type….>
</fieldset>
</form>
10By ShreyaChougule
HTML Form Elements
1) Input Element
2) Select Element:- The <select> element defines a drop-down
list.
The <option> elements defines an option that can be selected.
By default, the first item in the drop-down list is selected.
To define a pre-selected option, add the selected attribute to the
option:
<option value=“xyz" selected>Name of Selected value</option>
Syntax of select element:-
<select name=“abc">
<option value=“one">One</option>
<option value=“two">Two</option>
<option value=“….">…..</option>
<option value=“….">….</option>
</select>
11By ShreyaChougule
HTML Form Elements
2.Select Element:-
 Use the size attribute to specify the number of
visible values:
<select name="cars" size="3">
Here three values of car will be visible
 It allows multiple option selection.
 <select name="cars" size="4" multiple>
 Use ctrl to select multiple options at a time.
3. TextArea Element:-
The <textarea> element defines a multi-line input
field (a text area): 12By ShreyaChougule
HTML Form Elements
Example
<textarea name="message" rows="10" cols="30">
The cat was playing in the garden.
</textarea>
The rows attribute specifies the visible number of lines
in a text area.
The cols attribute specifies the visible width of a text
area.
4. Button Element:- This element defines clickable
button.
Syntax:-
<button type="button" onclick="alert('Hello
World!')">Click Me!</button>
13By ShreyaChougule
HTML Input Types
1. Input type Text:- <input type="text"> defines a one-
line text input field.
Syntax:- <form>
First name:<br>
<input type="text" name="firstname"><br>
Last name:<br>
<input type="text" name="lastname">
</form>
2. Input type Password:- <input type=“password”> it
gives password in asterisk mark or black dots.
Syntax:- <input type="password" name="psw">
3. Input type Submit:- <input type="submit"> defines a
button for submitting form data to a form-handler. 14By ShreyaChougule
HTML Input Types
The form-handler is typically a server page with a
script for processing input data.
The form-handler is specified in the
form's action attribute:
Syntax:- <input type="submit" value="Submit">
4. Input type Reset:- <input type="reset"> defines
a reset button that will reset all form values to
their default values.
Syntax:- <input type=“reset" value=“reset">
If you change the input values and then click the
"Reset" button, the form-data will be reset to the
default values.
15By ShreyaChougule
HTML Input Types
5. Input type radio:- <input type="radio"> defines a radio button.
Radio buttons let a user select ONLY ONE of a limited number of
choices
e.g.:-
<form>
<input type="radio" name="gender" value="male" checked> M
ale<br>
<input type="radio" name="gender" value="female"> Female<
br>
<input type="radio" name="gender" value="other"> Other
</form>
6. Input type Checkbox:- <input type="checkbox"> defines
a checkbox.
Checkboxes allows a user select ZERO or MORE options of a
limited number of choices. 16By ShreyaChougule
HTML Input Types
e.g. :- <form>
<input type="checkbox" name="vehicle1" value="Bike"> I have a
bike<br>
<input type="checkbox" name="vehicle2" value="Car"> I have a
car
</form>
7. Input type Button:-<input type="button"> defines a button
E.g.:- <input type="button" onclick="alert('Hello
World!')" value="Click Me!">
17By ShreyaChougule
HTML Input Attributes
1. Value Attribute:- The value attribute specifies the initial value
for an input field.
2. Readonly Attribute:- The readonly attribute specifies that the
input field is read only (cannot be changed)
3. Disabled Attribute:- The disabled attribute specifies that the
input field is disabled. A disabled input field is unusable and
un-clickable, and its value will not be sent when submitting
the form
4. The size attribute specifies the size (in characters) for the
input field
<form> First name:<br>
<input type="text" name="firstname" value="John" readonly
disabled size=“40”>
</form>
18By ShreyaChougule
Label tag in form tag
It is considered better to have label in form. As it makes the
code parser/browser/user friendly.
If you click on the label tag, it will focus on the text control. To
do so, you need to have for attribute in label tag that must be
same as id attribute of input tag.
<form>
<label for="firstname">First Name: </label>
<input type="text" id="firstname" name="firstname"/> <b
r/>
<label for="lastname">Last Name: </label>
<input type="text" id="lastname" name="lastname"/> <br
/>
</form>
19
By ShreyaChougule
HTML5 Input types
Input Type Color:The <input type="color"> is used for input fields
that should contain a color.
Depending on browser support, a color picker can show up in the
input field.
Input Type Date
The <input type="date"> is used for input fields that should
contain a date.
e.g.:-<form>
Select your favorite color:
<input type="color" name="favcolor">
<input type="date" name="bday">
</form>
. 20
By ShreyaChougule
HTML5 Input types
Input Type Email:-The <input type="email"> is used for input
fields that should contain an e-mail address.
Depending on browser support, the e-mail address can be
automatically validated when submitted.
Some smartphones recognize the email type, and adds ".com" to
the keyboard to match email input.
<input type="email" name="email">
Input Type File:-The <input type="file"> defines a file-select
field and a "Browse" button for file uploads.
Select a file: <input type="file" name="myFile">
Input Type Number:-The <input type="number"> defines
a numeric input field.
You can also set restrictions on what numbers are accepted.
.
21
By ShreyaChougule
HTML5 Input types
The following example displays a numeric input field, where you can
enter a value from 1 to 5:
<input type="number" name="quantity" min="1" max="5">
Input Type Range:-The <input type="range"> defines a control
for entering a number whose exact value is not important (like a
slider control). Default range is 0 to 100. However, you can set
restrictions on what numbers are accepted with the min, max,
and step attributes:
 <input type="range" name="points" min="0" max="10">
Input Type Search:-The <input type="search"> is used for search
fields (a search field behaves like a regular text field).
 Google:<input type="search" name="googlesearch">
22
By ShreyaChougule
HTML5 Input types
Input Type Url:-The <input type="url"> is used for input fields
that should contain a URL address.
Depending on browser support, the url field can be
automatically validated when submitted.
Some smartphones recognize the url type, and adds ".com" to
the
Add your homepage:
<input type="url" name="homepage">keyboard to match url
input.
23
By ShreyaChougule
HTML5 Attributes
HTML5 added the following attributes for <input>:form
The height and width Attributes:The height and width attributes
specify the height and width of an <input type="image"> element.
Always specify the size of images. If the browser does not know
the size, the page will flicker while images load.
<input type="image" src="img_submit.gif" alt="Submit" width="48
" height="48">
The list Attribute:-The list attribute refers to
a <datalist> element that contains pre-defined options for an
<input> element.
<input list="browsers"><datalist id="browsers">
<option value="Internet Explorer">
<option value="Firefox">
<option value="Chrome">
<option value="Opera">
<option value="Safari">
</datalist>
24
By ShreyaChougule
HTML5 Attributes
The min and max Attributes:-The min and max attributes specify
the minimum and maximum values for an <input> element.
The min and max attributes work with the following input types:
number, range, date, datetime-local, month, time and week.
 Enter a date before 1980-01-01:
<input type="date" name="bday" max="1979-12-31">
The multiple Attribute:-The multiple attribute specifies that the
user is allowed to enter more than one value in
the <input>element.
The multiple attribute works with the following input types:
email, and file.
 Select Files: <input type="file" name="img" multiple>
25
By ShreyaChougule
HTML5 Attributes
The placeholder Attribute:-The placeholder attribute specifies a
hint that describes the expected value of an input field (a sample
value or a short description of the format).
The hint is displayed in the input field before the user enters a
value.
The placeholder attribute works with the following input types:
text, search, url, tel, email, and password.
The required attribute:- specifies that an input field must be
filled out before submitting the form.
The required attribute works with the following input types:
text, search, url, tel, email, password, date pickers, number,
checkbox, radio, and file.
e.g. <input type="text" name="fname" placeholder="First name“
required>
26
By ShreyaChougule
HTML5 Attributes
27
By ShreyaChougule

More Related Content

What's hot

Web design - Working with forms in HTML
Web design - Working with forms in HTMLWeb design - Working with forms in HTML
Web design - Working with forms in HTML
Mustafa Kamel Mohammadi
 
Html forms
Html formsHtml forms
Html forms
Himanshu Pathak
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
AakankshaR
 
Html presentation
Html presentationHtml presentation
Html presentation
Amber Bhaumik
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypes
Varun C M
 
Html ppt
Html pptHtml ppt
Html ppt
santosh lamba
 
Html forms
Html formsHtml forms
HTML (Web) basics for a beginner
HTML (Web) basics for a beginnerHTML (Web) basics for a beginner
HTML (Web) basics for a beginner
Jayapal Reddy Nimmakayala
 
Javascript 101
Javascript 101Javascript 101
Javascript 101
Shlomi Komemi
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
eShikshak
 
HTML Tags
HTML TagsHTML Tags
HTML Tags
Pranay Agrawal
 
Javascript
JavascriptJavascript
Javascript
mussawir20
 
Datatype in JavaScript
Datatype in JavaScriptDatatype in JavaScript
Datatype in JavaScript
Rajat Saxena
 
Html coding
Html codingHtml coding
Html coding
Briana VanBuskirk
 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScript
Ravi Bhadauria
 
Javascript
JavascriptJavascript
Javascript
Manav Prasad
 
2. HTML forms
2. HTML forms2. HTML forms
2. HTML forms
Pavle Đorđević
 
CSS
CSSCSS
Presentation on HTML
Presentation on HTMLPresentation on HTML
Presentation on HTML
satvirsandhu9
 
Database Connectivity in PHP
Database Connectivity in PHPDatabase Connectivity in PHP
Database Connectivity in PHP
Taha Malampatti
 

What's hot (20)

Web design - Working with forms in HTML
Web design - Working with forms in HTMLWeb design - Working with forms in HTML
Web design - Working with forms in HTML
 
Html forms
Html formsHtml forms
Html forms
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
 
Html presentation
Html presentationHtml presentation
Html presentation
 
Javascript variables and datatypes
Javascript variables and datatypesJavascript variables and datatypes
Javascript variables and datatypes
 
Html ppt
Html pptHtml ppt
Html ppt
 
Html forms
Html formsHtml forms
Html forms
 
HTML (Web) basics for a beginner
HTML (Web) basics for a beginnerHTML (Web) basics for a beginner
HTML (Web) basics for a beginner
 
Javascript 101
Javascript 101Javascript 101
Javascript 101
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
HTML Tags
HTML TagsHTML Tags
HTML Tags
 
Javascript
JavascriptJavascript
Javascript
 
Datatype in JavaScript
Datatype in JavaScriptDatatype in JavaScript
Datatype in JavaScript
 
Html coding
Html codingHtml coding
Html coding
 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScript
 
Javascript
JavascriptJavascript
Javascript
 
2. HTML forms
2. HTML forms2. HTML forms
2. HTML forms
 
CSS
CSSCSS
CSS
 
Presentation on HTML
Presentation on HTMLPresentation on HTML
Presentation on HTML
 
Database Connectivity in PHP
Database Connectivity in PHPDatabase Connectivity in PHP
Database Connectivity in PHP
 

Similar to Html form tag

Designing web pages html forms and input
Designing web pages html  forms and inputDesigning web pages html  forms and input
Designing web pages html forms and input
Jesus Obenita Jr.
 
Html forms
Html formsHtml forms
Html forms
Html formsHtml forms
Html forms
nobel mujuji
 
Web forms and html lecture Number 4
Web forms and html lecture Number 4Web forms and html lecture Number 4
Web forms and html lecture Number 4
Mudasir Syed
 
Form using html and java script validation
Form using html and java script validationForm using html and java script validation
Form using html and java script validation
Maitree Patel
 
Html 4
Html   4Html   4
Html 4
Html   4Html   4
HTML FORMS.pptx
HTML FORMS.pptxHTML FORMS.pptx
HTML FORMS.pptx
Sierranaijamusic
 
Html Form Controls
Html Form ControlsHtml Form Controls
Forms,Frames.ppt
Forms,Frames.pptForms,Frames.ppt
Forms,Frames.ppt
MaheShiva
 
Forms,Frames.ppt
Forms,Frames.pptForms,Frames.ppt
Forms,Frames.ppt
MaheShiva
 
html forms
html formshtml forms
html forms
ikram niaz
 
CSS_Forms.pdf
CSS_Forms.pdfCSS_Forms.pdf
CSS_Forms.pdf
gunjansingh599205
 
HTML
HTML HTML
HTML Forms
HTML FormsHTML Forms
HTML Forms
bismakhan12
 
Html class-04
Html class-04Html class-04
Html class-04
Md Ali Hossain
 
HtmlForms- basic HTML forms description.
HtmlForms- basic HTML forms description.HtmlForms- basic HTML forms description.
HtmlForms- basic HTML forms description.
MohammadRafsunIslam
 
Html form
Html formHtml form
Html form
Jaya Kumari
 
20-html-forms.ppt
20-html-forms.ppt20-html-forms.ppt
20-html-forms.ppt
KarenCato1
 
Higher - HTML forms
Higher - HTML formsHigher - HTML forms
Higher - HTML forms
missstevenson01
 

Similar to Html form tag (20)

Designing web pages html forms and input
Designing web pages html  forms and inputDesigning web pages html  forms and input
Designing web pages html forms and input
 
Html forms
Html formsHtml forms
Html forms
 
Html forms
Html formsHtml forms
Html forms
 
Web forms and html lecture Number 4
Web forms and html lecture Number 4Web forms and html lecture Number 4
Web forms and html lecture Number 4
 
Form using html and java script validation
Form using html and java script validationForm using html and java script validation
Form using html and java script validation
 
Html 4
Html   4Html   4
Html 4
 
Html 4
Html   4Html   4
Html 4
 
HTML FORMS.pptx
HTML FORMS.pptxHTML FORMS.pptx
HTML FORMS.pptx
 
Html Form Controls
Html Form ControlsHtml Form Controls
Html Form Controls
 
Forms,Frames.ppt
Forms,Frames.pptForms,Frames.ppt
Forms,Frames.ppt
 
Forms,Frames.ppt
Forms,Frames.pptForms,Frames.ppt
Forms,Frames.ppt
 
html forms
html formshtml forms
html forms
 
CSS_Forms.pdf
CSS_Forms.pdfCSS_Forms.pdf
CSS_Forms.pdf
 
HTML
HTML HTML
HTML
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
Html class-04
Html class-04Html class-04
Html class-04
 
HtmlForms- basic HTML forms description.
HtmlForms- basic HTML forms description.HtmlForms- basic HTML forms description.
HtmlForms- basic HTML forms description.
 
Html form
Html formHtml form
Html form
 
20-html-forms.ppt
20-html-forms.ppt20-html-forms.ppt
20-html-forms.ppt
 
Higher - HTML forms
Higher - HTML formsHigher - HTML forms
Higher - HTML forms
 

Recently uploaded

IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
NazakatAliKhoso2
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
abbyasa1014
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
ihlasbinance2003
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
Aditya Rajan Patra
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
mamunhossenbd75
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
bijceesjournal
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
Dr Ramhari Poudyal
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
rpskprasana
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
zubairahmad848137
 

Recently uploaded (20)

IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
 
Recycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part IIRecycled Concrete Aggregate in Construction Part II
Recycled Concrete Aggregate in Construction Part II
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
 
Literature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptxLiterature Review Basics and Understanding Reference Management.pptx
Literature Review Basics and Understanding Reference Management.pptx
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Casting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdfCasting-Defect-inSlab continuous casting.pdf
Casting-Defect-inSlab continuous casting.pdf
 

Html form tag

  • 2. The <form> Element The HTML <form> element defines a form that is used to collect user input An HTML form contains different form elements. Form elements are types of input elements, like text fields, checkboxes, radio buttons, submit buttons, and more. Syntax of form is given by:- <form> . form elements(different input elements) . </form> 2By ShreyaChougule
  • 3. Use of The <input> Element The <input> element is one of the most important form element. The <input> element can be displayed in several ways, depending on the type attribute. Some of the types of input elements are as follows:- Type Description <input type=“text”> Gives one line text input <input type=“radio”> Used for selecting one of the many choices <input type=“submit”> Used for submitting form 3By ShreyaChougule
  • 4. Action Attribute The action attribute defines the action to be performed when the form is submitted. Normally, the form data is sent to a web page on the server when the user clicks on the submit button. If the action attribute is omitted, the action is set to the current page 4By ShreyaChougule
  • 5. Target Attribute The target attribute specifies if the submitted result will open in a new browser tab, or in the current window. The default value is "_self" which means the form will be submitted in the current window. To make the form result open in a new browser tab, use the value "_blank": <form action="/action_page.php" target="_blank"> 5By ShreyaChougule
  • 6. Method Attribute The method attribute specifies the HTTP method (GET or POST) to be used when submitting the form data. Get is used to request data from specified resource. Post is used to send data to server to create or update resource. Get method:-It gives content of form in web address <form action="/action_page.php" method="get"> Post method:-It does not give any content. <form action="/action_page.php" method=“post"> 6By ShreyaChougule
  • 7. Use of get method The default method when submitting form data is GET. However, when GET is used, the submitted form data will be visible in the page address field: /action_page.php?firstname=Mickey&lastname=Mouse Appends form-data into the URL in name/value pairs The length of a URL is limited (about 3000 characters) Never use GET to send sensitive data! (will be visible in the URL) GET is better for non-secure data, like query strings in Google 7By ShreyaChougule
  • 8. Use of Post Method Always use POST if the form data contains sensitive or personal information. The POST method does not display the submitted form data in the page address field. POST has no size limitations, and can be used to send large amounts of data. 8By ShreyaChougule
  • 9. Name Attribute Each input field must have a name attribute to be submitted. If the name attribute is omitted, the data of that input field will not be sent at all. If we use get method then the omitted name will not be visible at web address bar. Syntax:- <input type="text" name="lastname" value="Mouse"> OUTPUT 9By ShreyaChougule
  • 10. Grouping Form data Generally in order to group certain set of data in the form <fieldset> tag is used. The <legend> element defines a caption for the <fieldset> element. Syntax:-<form action=“”> <fieldset> <legend>Heading you want to display</legend> <label for=“”> <input type….> </fieldset> </form> 10By ShreyaChougule
  • 11. HTML Form Elements 1) Input Element 2) Select Element:- The <select> element defines a drop-down list. The <option> elements defines an option that can be selected. By default, the first item in the drop-down list is selected. To define a pre-selected option, add the selected attribute to the option: <option value=“xyz" selected>Name of Selected value</option> Syntax of select element:- <select name=“abc"> <option value=“one">One</option> <option value=“two">Two</option> <option value=“….">…..</option> <option value=“….">….</option> </select> 11By ShreyaChougule
  • 12. HTML Form Elements 2.Select Element:-  Use the size attribute to specify the number of visible values: <select name="cars" size="3"> Here three values of car will be visible  It allows multiple option selection.  <select name="cars" size="4" multiple>  Use ctrl to select multiple options at a time. 3. TextArea Element:- The <textarea> element defines a multi-line input field (a text area): 12By ShreyaChougule
  • 13. HTML Form Elements Example <textarea name="message" rows="10" cols="30"> The cat was playing in the garden. </textarea> The rows attribute specifies the visible number of lines in a text area. The cols attribute specifies the visible width of a text area. 4. Button Element:- This element defines clickable button. Syntax:- <button type="button" onclick="alert('Hello World!')">Click Me!</button> 13By ShreyaChougule
  • 14. HTML Input Types 1. Input type Text:- <input type="text"> defines a one- line text input field. Syntax:- <form> First name:<br> <input type="text" name="firstname"><br> Last name:<br> <input type="text" name="lastname"> </form> 2. Input type Password:- <input type=“password”> it gives password in asterisk mark or black dots. Syntax:- <input type="password" name="psw"> 3. Input type Submit:- <input type="submit"> defines a button for submitting form data to a form-handler. 14By ShreyaChougule
  • 15. HTML Input Types The form-handler is typically a server page with a script for processing input data. The form-handler is specified in the form's action attribute: Syntax:- <input type="submit" value="Submit"> 4. Input type Reset:- <input type="reset"> defines a reset button that will reset all form values to their default values. Syntax:- <input type=“reset" value=“reset"> If you change the input values and then click the "Reset" button, the form-data will be reset to the default values. 15By ShreyaChougule
  • 16. HTML Input Types 5. Input type radio:- <input type="radio"> defines a radio button. Radio buttons let a user select ONLY ONE of a limited number of choices e.g.:- <form> <input type="radio" name="gender" value="male" checked> M ale<br> <input type="radio" name="gender" value="female"> Female< br> <input type="radio" name="gender" value="other"> Other </form> 6. Input type Checkbox:- <input type="checkbox"> defines a checkbox. Checkboxes allows a user select ZERO or MORE options of a limited number of choices. 16By ShreyaChougule
  • 17. HTML Input Types e.g. :- <form> <input type="checkbox" name="vehicle1" value="Bike"> I have a bike<br> <input type="checkbox" name="vehicle2" value="Car"> I have a car </form> 7. Input type Button:-<input type="button"> defines a button E.g.:- <input type="button" onclick="alert('Hello World!')" value="Click Me!"> 17By ShreyaChougule
  • 18. HTML Input Attributes 1. Value Attribute:- The value attribute specifies the initial value for an input field. 2. Readonly Attribute:- The readonly attribute specifies that the input field is read only (cannot be changed) 3. Disabled Attribute:- The disabled attribute specifies that the input field is disabled. A disabled input field is unusable and un-clickable, and its value will not be sent when submitting the form 4. The size attribute specifies the size (in characters) for the input field <form> First name:<br> <input type="text" name="firstname" value="John" readonly disabled size=“40”> </form> 18By ShreyaChougule
  • 19. Label tag in form tag It is considered better to have label in form. As it makes the code parser/browser/user friendly. If you click on the label tag, it will focus on the text control. To do so, you need to have for attribute in label tag that must be same as id attribute of input tag. <form> <label for="firstname">First Name: </label> <input type="text" id="firstname" name="firstname"/> <b r/> <label for="lastname">Last Name: </label> <input type="text" id="lastname" name="lastname"/> <br /> </form> 19 By ShreyaChougule
  • 20. HTML5 Input types Input Type Color:The <input type="color"> is used for input fields that should contain a color. Depending on browser support, a color picker can show up in the input field. Input Type Date The <input type="date"> is used for input fields that should contain a date. e.g.:-<form> Select your favorite color: <input type="color" name="favcolor"> <input type="date" name="bday"> </form> . 20 By ShreyaChougule
  • 21. HTML5 Input types Input Type Email:-The <input type="email"> is used for input fields that should contain an e-mail address. Depending on browser support, the e-mail address can be automatically validated when submitted. Some smartphones recognize the email type, and adds ".com" to the keyboard to match email input. <input type="email" name="email"> Input Type File:-The <input type="file"> defines a file-select field and a "Browse" button for file uploads. Select a file: <input type="file" name="myFile"> Input Type Number:-The <input type="number"> defines a numeric input field. You can also set restrictions on what numbers are accepted. . 21 By ShreyaChougule
  • 22. HTML5 Input types The following example displays a numeric input field, where you can enter a value from 1 to 5: <input type="number" name="quantity" min="1" max="5"> Input Type Range:-The <input type="range"> defines a control for entering a number whose exact value is not important (like a slider control). Default range is 0 to 100. However, you can set restrictions on what numbers are accepted with the min, max, and step attributes:  <input type="range" name="points" min="0" max="10"> Input Type Search:-The <input type="search"> is used for search fields (a search field behaves like a regular text field).  Google:<input type="search" name="googlesearch"> 22 By ShreyaChougule
  • 23. HTML5 Input types Input Type Url:-The <input type="url"> is used for input fields that should contain a URL address. Depending on browser support, the url field can be automatically validated when submitted. Some smartphones recognize the url type, and adds ".com" to the Add your homepage: <input type="url" name="homepage">keyboard to match url input. 23 By ShreyaChougule
  • 24. HTML5 Attributes HTML5 added the following attributes for <input>:form The height and width Attributes:The height and width attributes specify the height and width of an <input type="image"> element. Always specify the size of images. If the browser does not know the size, the page will flicker while images load. <input type="image" src="img_submit.gif" alt="Submit" width="48 " height="48"> The list Attribute:-The list attribute refers to a <datalist> element that contains pre-defined options for an <input> element. <input list="browsers"><datalist id="browsers"> <option value="Internet Explorer"> <option value="Firefox"> <option value="Chrome"> <option value="Opera"> <option value="Safari"> </datalist> 24 By ShreyaChougule
  • 25. HTML5 Attributes The min and max Attributes:-The min and max attributes specify the minimum and maximum values for an <input> element. The min and max attributes work with the following input types: number, range, date, datetime-local, month, time and week.  Enter a date before 1980-01-01: <input type="date" name="bday" max="1979-12-31"> The multiple Attribute:-The multiple attribute specifies that the user is allowed to enter more than one value in the <input>element. The multiple attribute works with the following input types: email, and file.  Select Files: <input type="file" name="img" multiple> 25 By ShreyaChougule
  • 26. HTML5 Attributes The placeholder Attribute:-The placeholder attribute specifies a hint that describes the expected value of an input field (a sample value or a short description of the format). The hint is displayed in the input field before the user enters a value. The placeholder attribute works with the following input types: text, search, url, tel, email, and password. The required attribute:- specifies that an input field must be filled out before submitting the form. The required attribute works with the following input types: text, search, url, tel, email, password, date pickers, number, checkbox, radio, and file. e.g. <input type="text" name="fname" placeholder="First name“ required> 26 By ShreyaChougule