SlideShare a Scribd company logo
Prepared By: Er. Nawaraj
Bhandari
DESIGNING AND DEVELOPING A
WEBSITE
Topic 7:
HTML FORMS
Learning Outcomes
HTML Forms
 HTML Forms are a common and important part of
the web.
 Registration / login systems
 Search facilities
 HTML can be used to build forms.
 Define the text boxes, buttons, checkbox, radio
buttons, etc.
 HTML has no power to process the data entered
into a Form.
 The browser passes the data to scripts on the web
server.
 e.g. PHP, ASP.NET, Ruby
The Structure of Forms
 All HTML forms are constructed using the <form>
element.
 Identifies the start and end of an HTML form
The Structure of Forms
 The action attribute specifies the URL of the script
to which the data will be sent.
 It is a required attribute
 The method attribute specifies how the data will
be sent.
 The values can be get or post.
 We can nest most elements inside the <form>
element, e.g. <p>,<div>, <table>.
Form Controls
We can create button
using <input> tag or
<button> tag. What is the
difference?
Form Controls
 Form controls are the elements like the text boxes
and buttons used to gather data from the user.
 Most form controls are created using the <input/>
element.
 Empty element
 The type attribute is used to specify the type of
control.
 The name and id attribute is used by the script that
receives the data.
 Syntax :
Form Controls
Form Controls – Text Fields
 A value of ‘text’ for the type attribute specifies a text field.
 The size attribute is used to define the visible size of the
text field.
 The maxlength attribute is used to limit the number of
characters that can be entered.
 The value attribute can be used to specify a default value
for the text field.
Form Controls - Password
 A value of ‘password’ for the type attribute creates
a password field.
 The characters entered will be replaced with
asterisk or bullet characters.
Form Controls – Checkboxes
 Checkboxes allow users to select multiple options
from a list.
 A value of checkbox for the type element specifies
a checkbox.
 The checked attribute can be used to make the box
checked when the page loads.
 The value attribute is used to associate a piece of
data with the checkbox.
Form Controls – Radio Buttons
Form Controls – Radio Buttons
 Radio buttons allow users to select a single
option from a group.
 Selecting one deselects all the others
 To work together, all the radio buttons must
have the same value for the name attribute.
 The checked attribute allows the radio
button to be selected.
Form Controls – Buttons
 A value of submit for the type element specifies
a submit button.
 The submit button submits the form and sends
the contents of to the URL specified in the
action attribute.
 The value attribute can be used to change the
default text on the button
Form Controls – Buttons
 A value of reset for the type element specifies a reset
button.
 The reset button sets all controls back to their default
values.
 Reset buttons are rarely used.
 A value of button for the type element specifies a
normal button.
 The normal button does nothing by default. We put
JavaScript code in such button.
Form Controls – Multiline Text
Field
 The <textarea> element is used to create a
multiline text field.
 The cols and rows attributes specify the size
of the text area.
 A default value can be added as content in the
<textarea> element.
Form Controls – Select Menus
 The <select> element is structured like a
list
 The <option> element defines each item in the list.
 Again a value can be associated with the item.
Form Controls – Select Menus
 By default, the select menu works as a drop down
list.
 We can add a size attribute to make it a scrolling menu.
Accessible Forms – The <label>
Element
 The <label> element is used to associate a text
description with a form control.
 The form control needs an id attribute.
 The for attribute of the label element links the label to
the control.
 Clicking on the label automatically places focus on
the form element.
 All forms should use label elements.
Accessible Forms – The <fieldset>
and <legend> Elements
Accessible Forms – The <fieldset>
and <legend> Elements
 The <fieldset> element is used to group related
form controls together.
 The <legend> element is used to give this
group a title.
 Browsers provide default styling for the
<fieldset> element.
Accessible Forms – The <fieldset>
and <legend> Elements
 Browsers render the <fieldset> as a box
containing the form controls that are part of the
<fieldset>.
 Screen readers will read the <legend> content
before the each <label> element.
 E.g. Contact Details Email
Accessible Forms
 We have the same disadvantages
discussed previously.
 Browser support
 How does the user know the access key?
 Tab order breaking conventional flow
Form Controls and Valid Documents
 The <label>, <input/>, <textarea> and <select>
elements are all inline elements.
 Need to be nested inside a block level element for the page
to be valid.
 Form controls must be nested inside a <form>
element.
CSS and Forms
CSS and Forms
 The :focus pseudo class specifies a style for
when the form control is being focused.
 The outline property is commonly used to
highlight the form control.
CSS and Form – Attribute
Selectors
 We can use an attribute selector to target
specific types of form control.
 In this example, only form controls with a type
attribute of text will be affected by the rule.
Form Layout
Form Layout
 By default, browsers apply little styling to form.
 Possible approaches
1. Use <br/> elements
2. Use an HTML table
3. Use the CSS property
Form Layout – Using <br/>
Elements
 <br/> elements can be used to place
different elements on different lines.
 Limited control
 Adding presentation information through HTML!
Form Layout – Using Tables
 A simple table can be used to control form layout
Form Layout – Using Tables
Form Layout – Using CSS
 We can use the float
property to make form
controls wrap onto the
same lines.
 The clear property
makes the labels start
new lines.
Forms and Mobile Devices
 ‘free text’ input is difficult for many mobile
devices.
 Mobile devices often have input limitations.
 Use controls that do not require the user to type.
 Tab order can help users select controls.
Topic 7 – HTML Forms
Any Questions?

More Related Content

What's hot

Html forms
Html formsHtml forms
Html forms
Himanshu Pathak
 
Learning Html
Learning HtmlLearning Html
Learning Html
Damian Gonz
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript Programming
Sehwan Noh
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
Fahim Abdullah
 
Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)club23
 
Css
CssCss
Html n CSS
Html n CSSHtml n CSS
Html n CSS
Sukrit Gupta
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
Sanjeev Kumar
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
Amit Tyagi
 
Html ppt
Html pptHtml ppt
Html ppt
Ruchi Kumari
 
Basic Html Knowledge for students
Basic Html Knowledge for studentsBasic Html Knowledge for students
Basic Html Knowledge for students
vethics
 
CSS Introduction
CSS IntroductionCSS Introduction
CSS Introduction
Swati Sharma
 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
Amit Kumar Singh
 
Javascript
JavascriptJavascript
Javascript
mussawir20
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
Mohammed Arif
 
How to learn HTML in 10 Days
How to learn HTML in 10 DaysHow to learn HTML in 10 Days
How to learn HTML in 10 Days
Manoj kumar Deswal
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
Chris Poteet
 
JavaScript - Chapter 11 - Events
 JavaScript - Chapter 11 - Events  JavaScript - Chapter 11 - Events
JavaScript - Chapter 11 - Events
WebStackAcademy
 

What's hot (20)

Html forms
Html formsHtml forms
Html forms
 
Introduction to HTML and CSS
Introduction to HTML and CSSIntroduction to HTML and CSS
Introduction to HTML and CSS
 
Learning Html
Learning HtmlLearning Html
Learning Html
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript Programming
 
An Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java ScriptAn Overview of HTML, CSS & Java Script
An Overview of HTML, CSS & Java Script
 
Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)Html 5-tables-forms-frames (1)
Html 5-tables-forms-frames (1)
 
Css
CssCss
Css
 
Html n CSS
Html n CSSHtml n CSS
Html n CSS
 
CSS Basics
CSS BasicsCSS Basics
CSS Basics
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
Html frames
Html framesHtml frames
Html frames
 
Html ppt
Html pptHtml ppt
Html ppt
 
Basic Html Knowledge for students
Basic Html Knowledge for studentsBasic Html Knowledge for students
Basic Html Knowledge for students
 
CSS Introduction
CSS IntroductionCSS Introduction
CSS Introduction
 
CSS for Beginners
CSS for BeginnersCSS for Beginners
CSS for Beginners
 
Javascript
JavascriptJavascript
Javascript
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
 
How to learn HTML in 10 Days
How to learn HTML in 10 DaysHow to learn HTML in 10 Days
How to learn HTML in 10 Days
 
Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)Introduction to Cascading Style Sheets (CSS)
Introduction to Cascading Style Sheets (CSS)
 
JavaScript - Chapter 11 - Events
 JavaScript - Chapter 11 - Events  JavaScript - Chapter 11 - Events
JavaScript - Chapter 11 - Events
 

Similar to Html forms

CSS_Forms.pdf
CSS_Forms.pdfCSS_Forms.pdf
CSS_Forms.pdf
gunjansingh599205
 
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
 
Html Form Controls
Html Form ControlsHtml Form Controls
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZerStd 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Nuzhat Memon
 
Html form
Html formHtml form
Html form
Jaya Kumari
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
michael andrion
 
Javascript dom
Javascript domJavascript dom
Javascript dom
Muthuganesh S
 
ASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server Controls
Randy Connolly
 
HtmlForms- basic HTML forms description.
HtmlForms- basic HTML forms description.HtmlForms- basic HTML forms description.
HtmlForms- basic HTML forms description.
MohammadRafsunIslam
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
Nisa Soomro
 
20-html-forms.ppt
20-html-forms.ppt20-html-forms.ppt
20-html-forms.ppt
KarenCato1
 
html forms
html formshtml forms
html forms
ikram niaz
 
11-html-forms.ppt
11-html-forms.ppt11-html-forms.ppt
11-html-forms.ppt
karansingh4126
 
Web topic 20 1 html forms
Web topic 20 1  html formsWeb topic 20 1  html forms
Web topic 20 1 html formsCK Yang
 
Web Design & Development - Session 4
Web Design & Development - Session 4Web Design & Development - Session 4
Web Design & Development - Session 4
Shahrzad Peyman
 

Similar to Html forms (20)

CSS_Forms.pdf
CSS_Forms.pdfCSS_Forms.pdf
CSS_Forms.pdf
 
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
 
Web(chap2)
Web(chap2)Web(chap2)
Web(chap2)
 
Html Form Controls
Html Form ControlsHtml Form Controls
Html Form Controls
 
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZerStd 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
 
Html form
Html formHtml form
Html form
 
HTML
HTML HTML
HTML
 
Unit2
Unit2Unit2
Unit2
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
2. HTML forms
2. HTML forms2. HTML forms
2. HTML forms
 
M02 un11 p01
M02 un11 p01M02 un11 p01
M02 un11 p01
 
Javascript dom
Javascript domJavascript dom
Javascript dom
 
ASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server Controls
 
HtmlForms- basic HTML forms description.
HtmlForms- basic HTML forms description.HtmlForms- basic HTML forms description.
HtmlForms- basic HTML forms description.
 
HTML Forms
HTML FormsHTML Forms
HTML Forms
 
20-html-forms.ppt
20-html-forms.ppt20-html-forms.ppt
20-html-forms.ppt
 
html forms
html formshtml forms
html forms
 
11-html-forms.ppt
11-html-forms.ppt11-html-forms.ppt
11-html-forms.ppt
 
Web topic 20 1 html forms
Web topic 20 1  html formsWeb topic 20 1  html forms
Web topic 20 1 html forms
 
Web Design & Development - Session 4
Web Design & Development - Session 4Web Design & Development - Session 4
Web Design & Development - Session 4
 

More from Er. Nawaraj Bhandari

Data mining approaches and methods
Data mining approaches and methodsData mining approaches and methods
Data mining approaches and methods
Er. Nawaraj Bhandari
 
Research trends in data warehousing and data mining
Research trends in data warehousing and data miningResearch trends in data warehousing and data mining
Research trends in data warehousing and data mining
Er. Nawaraj Bhandari
 
Mining Association Rules in Large Database
Mining Association Rules in Large DatabaseMining Association Rules in Large Database
Mining Association Rules in Large Database
Er. Nawaraj Bhandari
 
Introduction to data mining and data warehousing
Introduction to data mining and data warehousingIntroduction to data mining and data warehousing
Introduction to data mining and data warehousing
Er. Nawaraj Bhandari
 
Data warehouse testing
Data warehouse testingData warehouse testing
Data warehouse testing
Er. Nawaraj Bhandari
 
Data warehouse physical design
Data warehouse physical designData warehouse physical design
Data warehouse physical design
Er. Nawaraj Bhandari
 
Data warehouse logical design
Data warehouse logical designData warehouse logical design
Data warehouse logical design
Er. Nawaraj Bhandari
 
Classification and prediction in data mining
Classification and prediction in data miningClassification and prediction in data mining
Classification and prediction in data mining
Er. Nawaraj Bhandari
 
Chapter 3: Simplification of Boolean Function
Chapter 3: Simplification of Boolean FunctionChapter 3: Simplification of Boolean Function
Chapter 3: Simplification of Boolean Function
Er. Nawaraj Bhandari
 
Chapter 6: Sequential Logic
Chapter 6: Sequential LogicChapter 6: Sequential Logic
Chapter 6: Sequential Logic
Er. Nawaraj Bhandari
 
Chapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSIChapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSI
Er. Nawaraj Bhandari
 
Chapter 4: Combinational Logic
Chapter 4: Combinational LogicChapter 4: Combinational Logic
Chapter 4: Combinational Logic
Er. Nawaraj Bhandari
 
Chapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic GatesChapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic Gates
Er. Nawaraj Bhandari
 
Chapter 1: Binary System
 Chapter 1: Binary System Chapter 1: Binary System
Chapter 1: Binary System
Er. Nawaraj Bhandari
 
Introduction to Electronic Commerce
Introduction to Electronic CommerceIntroduction to Electronic Commerce
Introduction to Electronic Commerce
Er. Nawaraj Bhandari
 
Evaluating software development
Evaluating software developmentEvaluating software development
Evaluating software development
Er. Nawaraj Bhandari
 
Using macros in microsoft excel part 2
Using macros in microsoft excel   part 2Using macros in microsoft excel   part 2
Using macros in microsoft excel part 2
Er. Nawaraj Bhandari
 
Using macros in microsoft excel part 1
Using macros in microsoft excel   part 1Using macros in microsoft excel   part 1
Using macros in microsoft excel part 1
Er. Nawaraj Bhandari
 
Using macros in microsoft access
Using macros in microsoft accessUsing macros in microsoft access
Using macros in microsoft access
Er. Nawaraj Bhandari
 
Testing software development
Testing software developmentTesting software development
Testing software development
Er. Nawaraj Bhandari
 

More from Er. Nawaraj Bhandari (20)

Data mining approaches and methods
Data mining approaches and methodsData mining approaches and methods
Data mining approaches and methods
 
Research trends in data warehousing and data mining
Research trends in data warehousing and data miningResearch trends in data warehousing and data mining
Research trends in data warehousing and data mining
 
Mining Association Rules in Large Database
Mining Association Rules in Large DatabaseMining Association Rules in Large Database
Mining Association Rules in Large Database
 
Introduction to data mining and data warehousing
Introduction to data mining and data warehousingIntroduction to data mining and data warehousing
Introduction to data mining and data warehousing
 
Data warehouse testing
Data warehouse testingData warehouse testing
Data warehouse testing
 
Data warehouse physical design
Data warehouse physical designData warehouse physical design
Data warehouse physical design
 
Data warehouse logical design
Data warehouse logical designData warehouse logical design
Data warehouse logical design
 
Classification and prediction in data mining
Classification and prediction in data miningClassification and prediction in data mining
Classification and prediction in data mining
 
Chapter 3: Simplification of Boolean Function
Chapter 3: Simplification of Boolean FunctionChapter 3: Simplification of Boolean Function
Chapter 3: Simplification of Boolean Function
 
Chapter 6: Sequential Logic
Chapter 6: Sequential LogicChapter 6: Sequential Logic
Chapter 6: Sequential Logic
 
Chapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSIChapter 5: Cominational Logic with MSI and LSI
Chapter 5: Cominational Logic with MSI and LSI
 
Chapter 4: Combinational Logic
Chapter 4: Combinational LogicChapter 4: Combinational Logic
Chapter 4: Combinational Logic
 
Chapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic GatesChapter 2: Boolean Algebra and Logic Gates
Chapter 2: Boolean Algebra and Logic Gates
 
Chapter 1: Binary System
 Chapter 1: Binary System Chapter 1: Binary System
Chapter 1: Binary System
 
Introduction to Electronic Commerce
Introduction to Electronic CommerceIntroduction to Electronic Commerce
Introduction to Electronic Commerce
 
Evaluating software development
Evaluating software developmentEvaluating software development
Evaluating software development
 
Using macros in microsoft excel part 2
Using macros in microsoft excel   part 2Using macros in microsoft excel   part 2
Using macros in microsoft excel part 2
 
Using macros in microsoft excel part 1
Using macros in microsoft excel   part 1Using macros in microsoft excel   part 1
Using macros in microsoft excel part 1
 
Using macros in microsoft access
Using macros in microsoft accessUsing macros in microsoft access
Using macros in microsoft access
 
Testing software development
Testing software developmentTesting software development
Testing software development
 

Recently uploaded

How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
Gal Baras
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
VivekSinghShekhawat2
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
laozhuseo02
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
nirahealhty
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
Javier Lasa
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
JungkooksNonexistent
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
GTProductions1
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 

Recently uploaded (20)

How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptxInternet-Security-Safeguarding-Your-Digital-World (1).pptx
Internet-Security-Safeguarding-Your-Digital-World (1).pptx
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 

Html forms

  • 1. Prepared By: Er. Nawaraj Bhandari DESIGNING AND DEVELOPING A WEBSITE Topic 7: HTML FORMS
  • 3. HTML Forms  HTML Forms are a common and important part of the web.  Registration / login systems  Search facilities  HTML can be used to build forms.  Define the text boxes, buttons, checkbox, radio buttons, etc.  HTML has no power to process the data entered into a Form.  The browser passes the data to scripts on the web server.  e.g. PHP, ASP.NET, Ruby
  • 4. The Structure of Forms  All HTML forms are constructed using the <form> element.  Identifies the start and end of an HTML form
  • 5. The Structure of Forms  The action attribute specifies the URL of the script to which the data will be sent.  It is a required attribute  The method attribute specifies how the data will be sent.  The values can be get or post.  We can nest most elements inside the <form> element, e.g. <p>,<div>, <table>.
  • 6. Form Controls We can create button using <input> tag or <button> tag. What is the difference?
  • 7. Form Controls  Form controls are the elements like the text boxes and buttons used to gather data from the user.  Most form controls are created using the <input/> element.  Empty element  The type attribute is used to specify the type of control.  The name and id attribute is used by the script that receives the data.  Syntax :
  • 9. Form Controls – Text Fields  A value of ‘text’ for the type attribute specifies a text field.  The size attribute is used to define the visible size of the text field.  The maxlength attribute is used to limit the number of characters that can be entered.  The value attribute can be used to specify a default value for the text field.
  • 10. Form Controls - Password  A value of ‘password’ for the type attribute creates a password field.  The characters entered will be replaced with asterisk or bullet characters.
  • 11. Form Controls – Checkboxes  Checkboxes allow users to select multiple options from a list.  A value of checkbox for the type element specifies a checkbox.  The checked attribute can be used to make the box checked when the page loads.  The value attribute is used to associate a piece of data with the checkbox.
  • 12. Form Controls – Radio Buttons
  • 13. Form Controls – Radio Buttons  Radio buttons allow users to select a single option from a group.  Selecting one deselects all the others  To work together, all the radio buttons must have the same value for the name attribute.  The checked attribute allows the radio button to be selected.
  • 14. Form Controls – Buttons  A value of submit for the type element specifies a submit button.  The submit button submits the form and sends the contents of to the URL specified in the action attribute.  The value attribute can be used to change the default text on the button
  • 15. Form Controls – Buttons  A value of reset for the type element specifies a reset button.  The reset button sets all controls back to their default values.  Reset buttons are rarely used.  A value of button for the type element specifies a normal button.  The normal button does nothing by default. We put JavaScript code in such button.
  • 16. Form Controls – Multiline Text Field  The <textarea> element is used to create a multiline text field.  The cols and rows attributes specify the size of the text area.  A default value can be added as content in the <textarea> element.
  • 17. Form Controls – Select Menus  The <select> element is structured like a list  The <option> element defines each item in the list.  Again a value can be associated with the item.
  • 18. Form Controls – Select Menus  By default, the select menu works as a drop down list.  We can add a size attribute to make it a scrolling menu.
  • 19. Accessible Forms – The <label> Element  The <label> element is used to associate a text description with a form control.  The form control needs an id attribute.  The for attribute of the label element links the label to the control.  Clicking on the label automatically places focus on the form element.  All forms should use label elements.
  • 20. Accessible Forms – The <fieldset> and <legend> Elements
  • 21. Accessible Forms – The <fieldset> and <legend> Elements  The <fieldset> element is used to group related form controls together.  The <legend> element is used to give this group a title.  Browsers provide default styling for the <fieldset> element.
  • 22. Accessible Forms – The <fieldset> and <legend> Elements  Browsers render the <fieldset> as a box containing the form controls that are part of the <fieldset>.  Screen readers will read the <legend> content before the each <label> element.  E.g. Contact Details Email
  • 23. Accessible Forms  We have the same disadvantages discussed previously.  Browser support  How does the user know the access key?  Tab order breaking conventional flow
  • 24. Form Controls and Valid Documents  The <label>, <input/>, <textarea> and <select> elements are all inline elements.  Need to be nested inside a block level element for the page to be valid.  Form controls must be nested inside a <form> element.
  • 26. CSS and Forms  The :focus pseudo class specifies a style for when the form control is being focused.  The outline property is commonly used to highlight the form control.
  • 27. CSS and Form – Attribute Selectors  We can use an attribute selector to target specific types of form control.  In this example, only form controls with a type attribute of text will be affected by the rule.
  • 29. Form Layout  By default, browsers apply little styling to form.  Possible approaches 1. Use <br/> elements 2. Use an HTML table 3. Use the CSS property
  • 30. Form Layout – Using <br/> Elements  <br/> elements can be used to place different elements on different lines.  Limited control  Adding presentation information through HTML!
  • 31. Form Layout – Using Tables  A simple table can be used to control form layout
  • 32. Form Layout – Using Tables
  • 33. Form Layout – Using CSS  We can use the float property to make form controls wrap onto the same lines.  The clear property makes the labels start new lines.
  • 34. Forms and Mobile Devices  ‘free text’ input is difficult for many mobile devices.  Mobile devices often have input limitations.  Use controls that do not require the user to type.  Tab order can help users select controls.
  • 35. Topic 7 – HTML Forms Any Questions?