SlideShare a Scribd company logo
webDeV@rgu
getting information from users
html forms
quick tip…
THE “SECURITY HACK” AT THE END OFTHIS PRESENTATION IS SOMETHINGTHAT EVERYONE SHOULD KNOW!
• HTML Forms
• Form Presentation
• Form Elements
• Input Types
• Input Attributes
• Form Security
Overview
HTML
Forms
• Capturing user input
• registering user information
• entering username and password for login
• posting status updates to social networks
• submitting a search query
• taking a questionnaire
• Transmitting user input elsewhere
• send to client side JavaScript for validation
• send to server side process (PHP, Java,
JavaScript)
Purpose of html Forms
Form
Presentation
a simple html form
• The form tag contains all the input elements
• <form> … </form>
• Input elements can be of <input type=“” />
• Text/password/file or textarea
• Radio button or Checkbox
• Select boxes
• All input elements should be given a form label
• Improves accessibility if using a screen reader
• <label> … </label>
• Fieldsets can be used to graphically group input
elements together
• <fieldset> … </fieldset>
Basic form elements
<form>
<fieldset>
<legend>Please leave a comment...</legend>
<label for="name">Name:</label>
<input type="text" name="name" value="" />
<label for="email">Email:</label>
<input type="text" name="email" value="" />
<label for="comments">Comment:</label>
<textarea name="comments" cols="45“ rows="5">
</textarea>
<input type="submit" value="Submit" />
</fieldset>
</form>
• Best practice is to use CSS
• However, tables are still used a lot for layout of
form elements
• better than a messy form
Form Presentation
<form>
<fieldset>
<legend>Please leave a comment...</legend>
<label for="name">Name:</label>
<input type="text" name="name" value="" />
<br>
<label for="email">Email:</label>
<input type="text" name="email" value="" />
<br>
<label for="comments">Comment:</label>
<textarea name="comments" cols="45" rows="5"></textarea>
<br>
<input type="submit" value="Submit" />
</fieldset>
</form>
<style> input, textarea {width: 400px;} </style>
<form>
<fieldset>
<legend>Please leave a comment...</legend>
<table>
<tr>
<td><label>Name:</label></td>
<td><input type="text" name="name" value="" /></td>
</tr>
<tr>
<td><label>Email:</label></td>
<td><input type="text" name="email" value="" /></td>
</tr>
<tr>
<td><label>Comment:</label></td>
<td><textarea name="comments" cols="45" rows="5">
</textarea></td>
</tr>
<tr>
<td colspan=2><input type="submit" value="Submit" /></td>
</tr>
</table>
</fieldset>
</form>
Column 1 Column 2
Row 1
Row 2
Row 3
Row 4
Form Presentation
• Best practice is to use CSS
• However, tables are still used a lot for layout of
form elements
• better than a messy form
• Next week we will look at CSS in a lot more detail
so that you can get the hang of it.
Form
elements
input types
• Provides simple text input
text
<form>
<label for=“firstname>First name:</label><br>
<input type="text" name="firstname"><br>
Last name:<br>
<input type="text" name="lastname">
</form>
• Provides text input that is hidden from the user
password
<form>
User name:<br>
<input type="text" name="username"><br>
User password:<br>
<input type="password" name="psw">
</form>
<form action=https://www.slideshare.net/slideshow/getting-information-through-html-forms/ First name:<br> <input type="text" name="firstname" value="Mike"><br> Last name:<br> <input type="text" name="lastname" value="Crabb"><br><br> <input type="submit" value="Submit"> </form> • Submit button for forms submit " class="vertical-slide-image VerticalSlideImage_image__VtE4p VerticalSlideImage_loading__3pG2z" data-testid="vertical-slide-image" loading="lazy" srcSet="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 1w" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" sizes="100vw"/>
<form>
Birthday:
<input type="date" name="bday">
</form>
• The <input type="date"> is used for input fields that
should contain a date.
date
• Provides for a selection of zero or more items from
a list of options
checkboxes
<input type="checkbox" name="pets" value="loveCats">I love cats <br>

<input type="checkbox" name="pets" value="loveDogs">I love dogs

• Provides for only one selection from a list of options
Radio buttons
<input type="radio" name="cats" value="loveCats">I love cats <br>

<input type="radio" name="cats" value="hateCats">I have no soul
• Choose from a list of options
• use the <select> tag
• list <options>
Selection (drop down) Box
<label for="degreeTitle">Degree Title:</label>

<select name="degreeTitle">

<option value="cs">Computer Science</option>

<option value="dm">Digital Media</option>

<option value="cnmd">Computer Network Management and Design</option
</select>
• Provides for only one selection from a list of options
coloUr
<form>
Select your favorite color:
<input type="color" name="favcolor">
</form>
• Provides for only one selection from a list of options
email
<form>
E-mail:
<input type="email" name="email">
<input type="submit">
</form>
• Provides for only one selection from a list of options
URL
<form>
Add your homepage:
<input type="url" name="homepage">
</form>
HTML5 form improvements
email
url
Reset
color
check input is valid email address
(something@something.something)
check input is valid web address
(http://www.something.something)
Clears everything on the page
Select a colour
american spelling
Form
elements
input attributes
• The value attribute specifies the initial value for an
input field:
value
<form action=https://www.slideshare.net/slideshow/getting-information-through-html-forms/ First name:<br> <input type="text" name="firstname" value="John"> <br> Last name:<br> <input type="text" name="lastname"> </form> " class="vertical-slide-image VerticalSlideImage_image__VtE4p VerticalSlideImage_loading__3pG2z" data-testid="vertical-slide-image" loading="lazy" srcSet="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 1w" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" sizes="100vw"/>
• The readonly attribute specifies that the input field
is read only (cannot be changed)
read only
<form action=https://www.slideshare.net/slideshow/getting-information-through-html-forms/ First name:<br> <input type="text" name="firstname" value="John" readonly> <br> Last name:<br> <input type="text" name="lastname"> </form> " class="vertical-slide-image VerticalSlideImage_image__VtE4p VerticalSlideImage_loading__3pG2z" data-testid="vertical-slide-image" loading="lazy" srcSet="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 1w" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" sizes="100vw"/>
• The disabled attribute specifies that the input field
is disabled.
• A disabled element is un-usable and un-clickable.
• Disabled elements will not be submitted
Disabled
<form action=https://www.slideshare.net/slideshow/getting-information-through-html-forms/ First name:<br> <input type="text" name="firstname" value="John" disabled> <br> Last name:<br> <input type="text" name="lastname"> </form> " class="vertical-slide-image VerticalSlideImage_image__VtE4p VerticalSlideImage_loading__3pG2z" data-testid="vertical-slide-image" loading="lazy" srcSet="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 1w" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" sizes="100vw"/>
• The size attribute specifies the size (in characters)
for the input field
size
<form action=https://www.slideshare.net/slideshow/getting-information-through-html-forms/ First name:<br> <input type="text" name="firstname" value="John" size="40"> <br> Last name:<br> <input type="text" name="lastname"> </form> " class="vertical-slide-image VerticalSlideImage_image__VtE4p VerticalSlideImage_loading__3pG2z" data-testid="vertical-slide-image" loading="lazy" srcSet="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 1w" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" sizes="100vw"/>
• The maxlength attribute specifies the maximum
allowed length for the input field:
maxlength
<form action=https://www.slideshare.net/slideshow/getting-information-through-html-forms/ First name:<br> <input type="text" name="firstname" maxlength="10"> <br> Last name:<br> <input type="text" name="lastname"> </form> " class="vertical-slide-image VerticalSlideImage_image__VtE4p VerticalSlideImage_loading__3pG2z" data-testid="vertical-slide-image" loading="lazy" srcSet="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7 1w" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" sizes="100vw"/>
• The autocomplete attribute specifies whether a
form or input field should have autocomplete on or
off
autocomplete
<form autocomplete="on">
First name:<input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
E-mail: <input type="email" name="email"
autocomplete="off"><br>
<input type="submit">
</form>
placeholder
• 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).
<input type="text" name="fname" placeholder="First name">
required
• When present, it 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.
Username: <input type="text" name="username" required>
This one is
important
form
security
form security
• Forms can be quite insecure when we are using
them, we need to make sure that the right data
is being seen by the right people
• and that no-one can get access to the
really sensitive data!
For example…here’s how to find our a password on
an unsecured computer
PS - DON’T DO THIS ONE SOMEONE ELSES
COMPUTER - YOU’ll GET INTO A LOT OF TROUBLE!!
I’ve visited a website and have put in my
username and password into the box
provided. Let’s say that now I have to step
away from my computer for 5 seconds…
Some unsavoury character comes along
and looks at my screen. They right click on
the password field and then go to inspect, I
wonder what they are up to?
Now they are looking at the HTML for this
web page and have an interest in the field
that my password is in. It’s ok…its secure
(it really isn’t).
They change the form element from:
<input type=“Password”>
to
<Input Type=“text”>
and now my password is being shown to the
world #awkward!
• HTML Forms
• Form Presentation
• Form Elements
• Input Types
• Input Attributes
• Form Security
Recap
get in touch!
@mike_crabb
Lecturer in Web Development at Robert Gordon University
(Scotland)
@rgucomputing
Robert Gordon University - School of Computing Science and
Digital Media

More Related Content

What's hot

The GaryVee Content Model
The GaryVee Content ModelThe GaryVee Content Model
The GaryVee Content Model
Gary Vaynerchuk
 
Basic HTML
Basic HTMLBasic HTML
Basic HTML
Sayan De
 
8tipsforslideshare 140205110030-phpapp01
8tipsforslideshare 140205110030-phpapp018tipsforslideshare 140205110030-phpapp01
8tipsforslideshare 140205110030-phpapp01
凱文 鄭
 
The Sketchnote Mini-Workshop
The Sketchnote Mini-WorkshopThe Sketchnote Mini-Workshop
The Sketchnote Mini-Workshop
Mike Rohde
 
Html
HtmlHtml
WEB I - 01 - Introduction to Web Development
WEB I - 01 - Introduction to Web DevelopmentWEB I - 01 - Introduction to Web Development
WEB I - 01 - Introduction to Web Development
Randy Connolly
 
Web Design & Development - Session 1
Web Design & Development - Session 1Web Design & Development - Session 1
Web Design & Development - Session 1
Shahrzad Peyman
 
2014 Target Case Competition
2014 Target Case Competition2014 Target Case Competition
2014 Target Case Competition
mdigiorgio29
 
Statistics to Know for Case Interview
Statistics to Know for Case InterviewStatistics to Know for Case Interview
Statistics to Know for Case Interview
Lewis Lin 🦊
 
The State of Sales & Marketing at the 50 Fastest-Growing B2B Companies
The State of Sales & Marketing at the 50 Fastest-Growing B2B CompaniesThe State of Sales & Marketing at the 50 Fastest-Growing B2B Companies
The State of Sales & Marketing at the 50 Fastest-Growing B2B Companies
Mattermark
 
The 27 Best Growth Hacking Tools of 2016
The 27 Best Growth Hacking Tools of 2016The 27 Best Growth Hacking Tools of 2016
The 27 Best Growth Hacking Tools of 2016
Wishpond
 
Questions product managers should ask customers
Questions product managers should ask customersQuestions product managers should ask customers
Questions product managers should ask customers
ProductPlan
 
The Great State of Design with CSS Grid Layout and Friends
The Great State of Design with CSS Grid Layout and FriendsThe Great State of Design with CSS Grid Layout and Friends
The Great State of Design with CSS Grid Layout and Friends
Stacy Kvernmo
 
How to Make Awesome Slides
How to Make Awesome SlidesHow to Make Awesome Slides
How to Make Awesome Slides
Safwan Brightwell
 
25 Need-to-Know Marketing Stats
25 Need-to-Know Marketing Stats25 Need-to-Know Marketing Stats
25 Need-to-Know Marketing Stats
contently
 
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
 
How To Sell To Non-Believers - Turning Doubt Into Trust
How To Sell To Non-Believers - Turning Doubt Into TrustHow To Sell To Non-Believers - Turning Doubt Into Trust
How To Sell To Non-Believers - Turning Doubt Into Trust
Close.io
 
Why Content Marketing Fails
Why Content Marketing FailsWhy Content Marketing Fails
Why Content Marketing Fails
Rand Fishkin
 
10 Ways Your Boss Kills Employee Motivation
10 Ways Your Boss Kills Employee Motivation10 Ways Your Boss Kills Employee Motivation
10 Ways Your Boss Kills Employee Motivation
Officevibe
 
Design your life in 2016
Design your life in 2016Design your life in 2016
Design your life in 2016
Koka Sexton 💼
 

What's hot (20)

The GaryVee Content Model
The GaryVee Content ModelThe GaryVee Content Model
The GaryVee Content Model
 
Basic HTML
Basic HTMLBasic HTML
Basic HTML
 
8tipsforslideshare 140205110030-phpapp01
8tipsforslideshare 140205110030-phpapp018tipsforslideshare 140205110030-phpapp01
8tipsforslideshare 140205110030-phpapp01
 
The Sketchnote Mini-Workshop
The Sketchnote Mini-WorkshopThe Sketchnote Mini-Workshop
The Sketchnote Mini-Workshop
 
Html
HtmlHtml
Html
 
WEB I - 01 - Introduction to Web Development
WEB I - 01 - Introduction to Web DevelopmentWEB I - 01 - Introduction to Web Development
WEB I - 01 - Introduction to Web Development
 
Web Design & Development - Session 1
Web Design & Development - Session 1Web Design & Development - Session 1
Web Design & Development - Session 1
 
2014 Target Case Competition
2014 Target Case Competition2014 Target Case Competition
2014 Target Case Competition
 
Statistics to Know for Case Interview
Statistics to Know for Case InterviewStatistics to Know for Case Interview
Statistics to Know for Case Interview
 
The State of Sales & Marketing at the 50 Fastest-Growing B2B Companies
The State of Sales & Marketing at the 50 Fastest-Growing B2B CompaniesThe State of Sales & Marketing at the 50 Fastest-Growing B2B Companies
The State of Sales & Marketing at the 50 Fastest-Growing B2B Companies
 
The 27 Best Growth Hacking Tools of 2016
The 27 Best Growth Hacking Tools of 2016The 27 Best Growth Hacking Tools of 2016
The 27 Best Growth Hacking Tools of 2016
 
Questions product managers should ask customers
Questions product managers should ask customersQuestions product managers should ask customers
Questions product managers should ask customers
 
The Great State of Design with CSS Grid Layout and Friends
The Great State of Design with CSS Grid Layout and FriendsThe Great State of Design with CSS Grid Layout and Friends
The Great State of Design with CSS Grid Layout and Friends
 
How to Make Awesome Slides
How to Make Awesome SlidesHow to Make Awesome Slides
How to Make Awesome Slides
 
25 Need-to-Know Marketing Stats
25 Need-to-Know Marketing Stats25 Need-to-Know Marketing Stats
25 Need-to-Know Marketing Stats
 
HTML (Web) basics for a beginner
HTML (Web) basics for a beginnerHTML (Web) basics for a beginner
HTML (Web) basics for a beginner
 
How To Sell To Non-Believers - Turning Doubt Into Trust
How To Sell To Non-Believers - Turning Doubt Into TrustHow To Sell To Non-Believers - Turning Doubt Into Trust
How To Sell To Non-Believers - Turning Doubt Into Trust
 
Why Content Marketing Fails
Why Content Marketing FailsWhy Content Marketing Fails
Why Content Marketing Fails
 
10 Ways Your Boss Kills Employee Motivation
10 Ways Your Boss Kills Employee Motivation10 Ways Your Boss Kills Employee Motivation
10 Ways Your Boss Kills Employee Motivation
 
Design your life in 2016
Design your life in 2016Design your life in 2016
Design your life in 2016
 

Viewers also liked

Montreal Girl Geeks: Building the Modern Web
Montreal Girl Geeks: Building the Modern WebMontreal Girl Geeks: Building the Modern Web
Montreal Girl Geeks: Building the Modern Web
Rachel Andrew
 
DESIGN THE PRIORITY, PERFORMANCE 
AND UX
DESIGN THE PRIORITY, PERFORMANCE 
AND UXDESIGN THE PRIORITY, PERFORMANCE 
AND UX
DESIGN THE PRIORITY, PERFORMANCE 
AND UX
Peter Rozek
 
Internet of Things - The Tip of an Iceberg
Internet of Things - The Tip of an IcebergInternet of Things - The Tip of an Iceberg
Internet of Things - The Tip of an Iceberg
Dr. Mazlan Abbas
 
Introduction to Development for the Internet
Introduction to Development for the InternetIntroduction to Development for the Internet
Introduction to Development for the Internet
Mike Crabb
 
Node.js and The Internet of Things
Node.js and The Internet of ThingsNode.js and The Internet of Things
Node.js and The Internet of Things
Losant
 
Finding Our Happy Place in the Internet of Things
Finding Our Happy Place in the Internet of ThingsFinding Our Happy Place in the Internet of Things
Finding Our Happy Place in the Internet of Things
Pamela Pavliscak
 
Build Features, Not Apps
Build Features, Not AppsBuild Features, Not Apps
Build Features, Not Apps
Natasha Murashev
 
Valentine's Day
Valentine's DayValentine's Day
Valentine's Day
Ingenico ePayments
 
Health and Well-Being on the Social Web
Health and Well-Being on the Social WebHealth and Well-Being on the Social Web
Health and Well-Being on the Social Web
ron mader
 
How Much Further Will Internet Stocks Fall? (Share Price Performance)
How Much Further Will Internet Stocks Fall? (Share Price Performance)How Much Further Will Internet Stocks Fall? (Share Price Performance)
How Much Further Will Internet Stocks Fall? (Share Price Performance)
Mahesh Vellanki
 
Net neutrality: The Basics
Net neutrality: The BasicsNet neutrality: The Basics
Net neutrality: The Basics
InterQuest Group
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
Seth Familian
 
25 Festive Fonts For Women Oriented Businesses!
25 Festive Fonts For Women Oriented Businesses!25 Festive Fonts For Women Oriented Businesses!
25 Festive Fonts For Women Oriented Businesses!
DesignMantic
 
Digital in 2016
Digital in 2016Digital in 2016
Digital in 2016
We Are Social Singapore
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging Challenges
Aaron Irizarry
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
LinkedIn
 
Mobile-First SEO - The Marketers Edition #3XEDigital
Mobile-First SEO - The Marketers Edition #3XEDigitalMobile-First SEO - The Marketers Edition #3XEDigital
Mobile-First SEO - The Marketers Edition #3XEDigital
Aleyda Solís
 
Mobile Is Eating the World (2016)
Mobile Is Eating the World (2016)Mobile Is Eating the World (2016)
Mobile Is Eating the World (2016)
a16z
 
UX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and ArchivesUX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and Archives
Ned Potter
 
IT in Healthcare
IT in HealthcareIT in Healthcare
IT in Healthcare
NetApp
 

Viewers also liked (20)

Montreal Girl Geeks: Building the Modern Web
Montreal Girl Geeks: Building the Modern WebMontreal Girl Geeks: Building the Modern Web
Montreal Girl Geeks: Building the Modern Web
 
DESIGN THE PRIORITY, PERFORMANCE 
AND UX
DESIGN THE PRIORITY, PERFORMANCE 
AND UXDESIGN THE PRIORITY, PERFORMANCE 
AND UX
DESIGN THE PRIORITY, PERFORMANCE 
AND UX
 
Internet of Things - The Tip of an Iceberg
Internet of Things - The Tip of an IcebergInternet of Things - The Tip of an Iceberg
Internet of Things - The Tip of an Iceberg
 
Introduction to Development for the Internet
Introduction to Development for the InternetIntroduction to Development for the Internet
Introduction to Development for the Internet
 
Node.js and The Internet of Things
Node.js and The Internet of ThingsNode.js and The Internet of Things
Node.js and The Internet of Things
 
Finding Our Happy Place in the Internet of Things
Finding Our Happy Place in the Internet of ThingsFinding Our Happy Place in the Internet of Things
Finding Our Happy Place in the Internet of Things
 
Build Features, Not Apps
Build Features, Not AppsBuild Features, Not Apps
Build Features, Not Apps
 
Valentine's Day
Valentine's DayValentine's Day
Valentine's Day
 
Health and Well-Being on the Social Web
Health and Well-Being on the Social WebHealth and Well-Being on the Social Web
Health and Well-Being on the Social Web
 
How Much Further Will Internet Stocks Fall? (Share Price Performance)
How Much Further Will Internet Stocks Fall? (Share Price Performance)How Much Further Will Internet Stocks Fall? (Share Price Performance)
How Much Further Will Internet Stocks Fall? (Share Price Performance)
 
Net neutrality: The Basics
Net neutrality: The BasicsNet neutrality: The Basics
Net neutrality: The Basics
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
 
25 Festive Fonts For Women Oriented Businesses!
25 Festive Fonts For Women Oriented Businesses!25 Festive Fonts For Women Oriented Businesses!
25 Festive Fonts For Women Oriented Businesses!
 
Digital in 2016
Digital in 2016Digital in 2016
Digital in 2016
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging Challenges
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 
Mobile-First SEO - The Marketers Edition #3XEDigital
Mobile-First SEO - The Marketers Edition #3XEDigitalMobile-First SEO - The Marketers Edition #3XEDigital
Mobile-First SEO - The Marketers Edition #3XEDigital
 
Mobile Is Eating the World (2016)
Mobile Is Eating the World (2016)Mobile Is Eating the World (2016)
Mobile Is Eating the World (2016)
 
UX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and ArchivesUX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and Archives
 
IT in Healthcare
IT in HealthcareIT in Healthcare
IT in Healthcare
 

Similar to Getting Information through HTML Forms

Html tables, forms and audio video
Html tables, forms and audio videoHtml tables, forms and audio video
Html tables, forms and audio video
Saad Sheikh
 
Web forms and html (lect 4)
Web forms and html (lect 4)Web forms and html (lect 4)
Web forms and html (lect 4)
Salman Memon
 
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
 
Forms
FormsForms
Forms
myrajendra
 
Html forms
Html formsHtml forms
Html forms
Himanshu Pathak
 
htmlcss.pdf
htmlcss.pdfhtmlcss.pdf
htmlcss.pdf
ElieMambou1
 
CSS_Forms.pdf
CSS_Forms.pdfCSS_Forms.pdf
CSS_Forms.pdf
gunjansingh599205
 
Html forms
Html formsHtml forms
Html forms
nobel mujuji
 
web-lab2 for computer science html tss css java
web-lab2 for computer science html tss css javaweb-lab2 for computer science html tss css java
web-lab2 for computer science html tss css java
shereifhany
 
Web engineering - HTML Form
Web engineering -  HTML FormWeb engineering -  HTML Form
Web engineering - HTML Form
Nosheen Qamar
 
HTML Forms Basics by Kamran Solangi.pptx
HTML Forms Basics by Kamran Solangi.pptxHTML Forms Basics by Kamran Solangi.pptx
HTML Forms Basics by Kamran Solangi.pptx
KamranSolangi1
 
HTML5 - Forms
HTML5 - FormsHTML5 - Forms
HTML5 - Forms
tina1357
 
Forms Part 1
Forms Part 1Forms Part 1
Forms Part 1
kjkleindorfer
 
Unit 2 (it workshop)
Unit 2 (it workshop)Unit 2 (it workshop)
Unit 2 (it workshop)
Dr.Lokesh Gagnani
 
FormL13.pptx
FormL13.pptxFormL13.pptx
FormL13.pptx
serd4
 
HTML
HTML HTML
Chapter 9: Forms
Chapter 9: FormsChapter 9: Forms
Chapter 9: Forms
Steve Guinan
 
uptu web technology unit 2 html
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 html
Abhishek Kesharwani
 
Lesson 15
Lesson 15Lesson 15
Lesson 15
Gene Babon
 
INTRODUCTION TO HTML & CSS .pptx
INTRODUCTION TO HTML & CSS .pptxINTRODUCTION TO HTML & CSS .pptx
INTRODUCTION TO HTML & CSS .pptx
SarthakrOkr
 

Similar to Getting Information through HTML Forms (20)

Html tables, forms and audio video
Html tables, forms and audio videoHtml tables, forms and audio video
Html tables, forms and audio video
 
Web forms and html (lect 4)
Web forms and html (lect 4)Web forms and html (lect 4)
Web forms and html (lect 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
 
Forms
FormsForms
Forms
 
Html forms
Html formsHtml forms
Html forms
 
htmlcss.pdf
htmlcss.pdfhtmlcss.pdf
htmlcss.pdf
 
CSS_Forms.pdf
CSS_Forms.pdfCSS_Forms.pdf
CSS_Forms.pdf
 
Html forms
Html formsHtml forms
Html forms
 
web-lab2 for computer science html tss css java
web-lab2 for computer science html tss css javaweb-lab2 for computer science html tss css java
web-lab2 for computer science html tss css java
 
Web engineering - HTML Form
Web engineering -  HTML FormWeb engineering -  HTML Form
Web engineering - HTML Form
 
HTML Forms Basics by Kamran Solangi.pptx
HTML Forms Basics by Kamran Solangi.pptxHTML Forms Basics by Kamran Solangi.pptx
HTML Forms Basics by Kamran Solangi.pptx
 
HTML5 - Forms
HTML5 - FormsHTML5 - Forms
HTML5 - Forms
 
Forms Part 1
Forms Part 1Forms Part 1
Forms Part 1
 
Unit 2 (it workshop)
Unit 2 (it workshop)Unit 2 (it workshop)
Unit 2 (it workshop)
 
FormL13.pptx
FormL13.pptxFormL13.pptx
FormL13.pptx
 
HTML
HTML HTML
HTML
 
Chapter 9: Forms
Chapter 9: FormsChapter 9: Forms
Chapter 9: Forms
 
uptu web technology unit 2 html
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 html
 
Lesson 15
Lesson 15Lesson 15
Lesson 15
 
INTRODUCTION TO HTML & CSS .pptx
INTRODUCTION TO HTML & CSS .pptxINTRODUCTION TO HTML & CSS .pptx
INTRODUCTION TO HTML & CSS .pptx
 

More from Mike Crabb

Hard to Reach Users in Easy to Reach Places
Hard to Reach Users in Easy to Reach PlacesHard to Reach Users in Easy to Reach Places
Hard to Reach Users in Easy to Reach Places
Mike Crabb
 
Accessible and Assistive Interfaces
Accessible and Assistive InterfacesAccessible and Assistive Interfaces
Accessible and Assistive Interfaces
Mike Crabb
 
Accessible Everyone
Accessible EveryoneAccessible Everyone
Accessible Everyone
Mike Crabb
 
The Peer Review Process
The Peer Review ProcessThe Peer Review Process
The Peer Review Process
Mike Crabb
 
Managing Quality In Qualitative Research
Managing Quality In Qualitative ResearchManaging Quality In Qualitative Research
Managing Quality In Qualitative Research
Mike Crabb
 
Analysing Qualitative Data
Analysing Qualitative DataAnalysing Qualitative Data
Analysing Qualitative Data
Mike Crabb
 
Conversation Discourse and Document Analysis
Conversation Discourse and Document AnalysisConversation Discourse and Document Analysis
Conversation Discourse and Document Analysis
Mike Crabb
 
Ethnographic and Observational Research
Ethnographic and Observational ResearchEthnographic and Observational Research
Ethnographic and Observational Research
Mike Crabb
 
Doing Focus Groups
Doing Focus GroupsDoing Focus Groups
Doing Focus Groups
Mike Crabb
 
Doing Interviews
Doing InterviewsDoing Interviews
Doing Interviews
Mike Crabb
 
Designing Qualitative Research
Designing Qualitative ResearchDesigning Qualitative Research
Designing Qualitative Research
Mike Crabb
 
Introduction to Accessible Design
Introduction to Accessible DesignIntroduction to Accessible Design
Introduction to Accessible Design
Mike Crabb
 
Accessible Everyone
Accessible EveryoneAccessible Everyone
Accessible Everyone
Mike Crabb
 
Texture and Glyph Design
Texture and Glyph DesignTexture and Glyph Design
Texture and Glyph Design
Mike Crabb
 
Pattern Perception and Map Design
Pattern Perception and Map DesignPattern Perception and Map Design
Pattern Perception and Map Design
Mike Crabb
 
Dealing with Enterprise Level Data
Dealing with Enterprise Level DataDealing with Enterprise Level Data
Dealing with Enterprise Level Data
Mike Crabb
 
Using Cloud in an Enterprise Environment
Using Cloud in an Enterprise EnvironmentUsing Cloud in an Enterprise Environment
Using Cloud in an Enterprise Environment
Mike Crabb
 
Teaching Cloud to the Programmers of Tomorrow
Teaching Cloud to the Programmers of TomorrowTeaching Cloud to the Programmers of Tomorrow
Teaching Cloud to the Programmers of Tomorrow
Mike Crabb
 
Sql Injection and XSS
Sql Injection and XSSSql Injection and XSS
Sql Injection and XSS
Mike Crabb
 
Forms and Databases in PHP
Forms and Databases in PHPForms and Databases in PHP
Forms and Databases in PHP
Mike Crabb
 

More from Mike Crabb (20)

Hard to Reach Users in Easy to Reach Places
Hard to Reach Users in Easy to Reach PlacesHard to Reach Users in Easy to Reach Places
Hard to Reach Users in Easy to Reach Places
 
Accessible and Assistive Interfaces
Accessible and Assistive InterfacesAccessible and Assistive Interfaces
Accessible and Assistive Interfaces
 
Accessible Everyone
Accessible EveryoneAccessible Everyone
Accessible Everyone
 
The Peer Review Process
The Peer Review ProcessThe Peer Review Process
The Peer Review Process
 
Managing Quality In Qualitative Research
Managing Quality In Qualitative ResearchManaging Quality In Qualitative Research
Managing Quality In Qualitative Research
 
Analysing Qualitative Data
Analysing Qualitative DataAnalysing Qualitative Data
Analysing Qualitative Data
 
Conversation Discourse and Document Analysis
Conversation Discourse and Document AnalysisConversation Discourse and Document Analysis
Conversation Discourse and Document Analysis
 
Ethnographic and Observational Research
Ethnographic and Observational ResearchEthnographic and Observational Research
Ethnographic and Observational Research
 
Doing Focus Groups
Doing Focus GroupsDoing Focus Groups
Doing Focus Groups
 
Doing Interviews
Doing InterviewsDoing Interviews
Doing Interviews
 
Designing Qualitative Research
Designing Qualitative ResearchDesigning Qualitative Research
Designing Qualitative Research
 
Introduction to Accessible Design
Introduction to Accessible DesignIntroduction to Accessible Design
Introduction to Accessible Design
 
Accessible Everyone
Accessible EveryoneAccessible Everyone
Accessible Everyone
 
Texture and Glyph Design
Texture and Glyph DesignTexture and Glyph Design
Texture and Glyph Design
 
Pattern Perception and Map Design
Pattern Perception and Map DesignPattern Perception and Map Design
Pattern Perception and Map Design
 
Dealing with Enterprise Level Data
Dealing with Enterprise Level DataDealing with Enterprise Level Data
Dealing with Enterprise Level Data
 
Using Cloud in an Enterprise Environment
Using Cloud in an Enterprise EnvironmentUsing Cloud in an Enterprise Environment
Using Cloud in an Enterprise Environment
 
Teaching Cloud to the Programmers of Tomorrow
Teaching Cloud to the Programmers of TomorrowTeaching Cloud to the Programmers of Tomorrow
Teaching Cloud to the Programmers of Tomorrow
 
Sql Injection and XSS
Sql Injection and XSSSql Injection and XSS
Sql Injection and XSS
 
Forms and Databases in PHP
Forms and Databases in PHPForms and Databases in PHP
Forms and Databases in PHP
 

Recently uploaded

The-Power-of-Content-Marketing-in-real- World.pptx
The-Power-of-Content-Marketing-in-real- World.pptxThe-Power-of-Content-Marketing-in-real- World.pptx
The-Power-of-Content-Marketing-in-real- World.pptx
ownershipvipclubmemb
 
Introduction-to-Short-tail-and-Long-tail-Keywords (2).pptx
Introduction-to-Short-tail-and-Long-tail-Keywords (2).pptxIntroduction-to-Short-tail-and-Long-tail-Keywords (2).pptx
Introduction-to-Short-tail-and-Long-tail-Keywords (2).pptx
sanjoligu76
 
Blue and Green Business Roadmap Presentation.pptx
Blue and Green Business Roadmap Presentation.pptxBlue and Green Business Roadmap Presentation.pptx
Blue and Green Business Roadmap Presentation.pptx
ssusere387ba
 
SS26 Women's Fashion Peclers Paris Trend Book
SS26 Women's Fashion Peclers Paris Trend BookSS26 Women's Fashion Peclers Paris Trend Book
SS26 Women's Fashion Peclers Paris Trend Book
Peclers Paris
 
DITL 服務設計個案 公立動物收容所的服務優化與擴散,延續前一年的服務內容,本以為可以複製,但是卻因為場域的差異所以必須大幅修正
DITL 服務設計個案 公立動物收容所的服務優化與擴散,延續前一年的服務內容,本以為可以複製,但是卻因為場域的差異所以必須大幅修正DITL 服務設計個案 公立動物收容所的服務優化與擴散,延續前一年的服務內容,本以為可以複製,但是卻因為場域的差異所以必須大幅修正
DITL 服務設計個案 公立動物收容所的服務優化與擴散,延續前一年的服務內容,本以為可以複製,但是卻因為場域的差異所以必須大幅修正
NTUST
 
Mounded storage vessels presentation.pptx
Mounded storage vessels presentation.pptxMounded storage vessels presentation.pptx
Mounded storage vessels presentation.pptx
AbhaysinhShinde
 
Wijkbot_PublicSpaces - adapted version.pdf
Wijkbot_PublicSpaces - adapted version.pdfWijkbot_PublicSpaces - adapted version.pdf
Wijkbot_PublicSpaces - adapted version.pdf
Iskander Smit
 
USYD degree Cert diploma Transcripta
USYD degree Cert diploma Transcripta USYD degree Cert diploma Transcripta
USYD degree Cert diploma Transcripta
ufynvyq
 
Current Affairs Pointer, Weekly 01 June to 15 June, 2024.pdf
Current Affairs Pointer, Weekly 01 June to 15 June, 2024.pdfCurrent Affairs Pointer, Weekly 01 June to 15 June, 2024.pdf
Current Affairs Pointer, Weekly 01 June to 15 June, 2024.pdf
21101141901saurav
 
DU degree Cert diploma Transcripta
DU degree Cert diploma Transcripta DU degree Cert diploma Transcripta
DU degree Cert diploma Transcripta
dgyabg
 
LTU degree Cert diploma Transcripta
LTU degree Cert diploma Transcripta LTU degree Cert diploma Transcripta
LTU degree Cert diploma Transcripta
ouxsup
 
BitsAtom Profile - Technology in Each Bit
BitsAtom Profile - Technology in Each BitBitsAtom Profile - Technology in Each Bit
BitsAtom Profile - Technology in Each Bit
sonal218507
 
SLU degree Cert diploma Transcripta
SLU degree Cert diploma Transcripta SLU degree Cert diploma Transcripta
SLU degree Cert diploma Transcripta
ewacyco
 
SS26 Environments & Design Peclers Paris Trend Book
SS26 Environments & Design Peclers Paris Trend BookSS26 Environments & Design Peclers Paris Trend Book
SS26 Environments & Design Peclers Paris Trend Book
Peclers Paris
 
AIS学位证
AIS学位证AIS学位证
AIS学位证
efacukh
 
GU degree Cert diploma Transcripta
GU degree Cert diploma Transcripta GU degree Cert diploma Transcripta
GU degree Cert diploma Transcripta
esadb1
 
一比一原版澳洲圣母大学毕业证(UNDA毕业证书)如何办理
一比一原版澳洲圣母大学毕业证(UNDA毕业证书)如何办理一比一原版澳洲圣母大学毕业证(UNDA毕业证书)如何办理
一比一原版澳洲圣母大学毕业证(UNDA毕业证书)如何办理
taqyea
 
后入办公室丰满少妇→→(网祉:5j8.net)极品美女口爆←←【(网站:5j8.net)】
后入办公室丰满少妇→→(网祉:5j8.net)极品美女口爆←←【(网站:5j8.net)】后入办公室丰满少妇→→(网祉:5j8.net)极品美女口爆←←【(网站:5j8.net)】
后入办公室丰满少妇→→(网祉:5j8.net)极品美女口爆←←【(网站:5j8.net)】
q8k467jx
 
ATAL_Selected_FDPs_AY_2lllllgg024_25.pdf
ATAL_Selected_FDPs_AY_2lllllgg024_25.pdfATAL_Selected_FDPs_AY_2lllllgg024_25.pdf
ATAL_Selected_FDPs_AY_2lllllgg024_25.pdf
Kesavan T
 
一比一原版莫纳什大学毕业证(Monash毕业证)如何办理
一比一原版莫纳什大学毕业证(Monash毕业证)如何办理一比一原版莫纳什大学毕业证(Monash毕业证)如何办理
一比一原版莫纳什大学毕业证(Monash毕业证)如何办理
taqyea
 

Recently uploaded (20)

The-Power-of-Content-Marketing-in-real- World.pptx
The-Power-of-Content-Marketing-in-real- World.pptxThe-Power-of-Content-Marketing-in-real- World.pptx
The-Power-of-Content-Marketing-in-real- World.pptx
 
Introduction-to-Short-tail-and-Long-tail-Keywords (2).pptx
Introduction-to-Short-tail-and-Long-tail-Keywords (2).pptxIntroduction-to-Short-tail-and-Long-tail-Keywords (2).pptx
Introduction-to-Short-tail-and-Long-tail-Keywords (2).pptx
 
Blue and Green Business Roadmap Presentation.pptx
Blue and Green Business Roadmap Presentation.pptxBlue and Green Business Roadmap Presentation.pptx
Blue and Green Business Roadmap Presentation.pptx
 
SS26 Women's Fashion Peclers Paris Trend Book
SS26 Women's Fashion Peclers Paris Trend BookSS26 Women's Fashion Peclers Paris Trend Book
SS26 Women's Fashion Peclers Paris Trend Book
 
DITL 服務設計個案 公立動物收容所的服務優化與擴散,延續前一年的服務內容,本以為可以複製,但是卻因為場域的差異所以必須大幅修正
DITL 服務設計個案 公立動物收容所的服務優化與擴散,延續前一年的服務內容,本以為可以複製,但是卻因為場域的差異所以必須大幅修正DITL 服務設計個案 公立動物收容所的服務優化與擴散,延續前一年的服務內容,本以為可以複製,但是卻因為場域的差異所以必須大幅修正
DITL 服務設計個案 公立動物收容所的服務優化與擴散,延續前一年的服務內容,本以為可以複製,但是卻因為場域的差異所以必須大幅修正
 
Mounded storage vessels presentation.pptx
Mounded storage vessels presentation.pptxMounded storage vessels presentation.pptx
Mounded storage vessels presentation.pptx
 
Wijkbot_PublicSpaces - adapted version.pdf
Wijkbot_PublicSpaces - adapted version.pdfWijkbot_PublicSpaces - adapted version.pdf
Wijkbot_PublicSpaces - adapted version.pdf
 
USYD degree Cert diploma Transcripta
USYD degree Cert diploma Transcripta USYD degree Cert diploma Transcripta
USYD degree Cert diploma Transcripta
 
Current Affairs Pointer, Weekly 01 June to 15 June, 2024.pdf
Current Affairs Pointer, Weekly 01 June to 15 June, 2024.pdfCurrent Affairs Pointer, Weekly 01 June to 15 June, 2024.pdf
Current Affairs Pointer, Weekly 01 June to 15 June, 2024.pdf
 
DU degree Cert diploma Transcripta
DU degree Cert diploma Transcripta DU degree Cert diploma Transcripta
DU degree Cert diploma Transcripta
 
LTU degree Cert diploma Transcripta
LTU degree Cert diploma Transcripta LTU degree Cert diploma Transcripta
LTU degree Cert diploma Transcripta
 
BitsAtom Profile - Technology in Each Bit
BitsAtom Profile - Technology in Each BitBitsAtom Profile - Technology in Each Bit
BitsAtom Profile - Technology in Each Bit
 
SLU degree Cert diploma Transcripta
SLU degree Cert diploma Transcripta SLU degree Cert diploma Transcripta
SLU degree Cert diploma Transcripta
 
SS26 Environments & Design Peclers Paris Trend Book
SS26 Environments & Design Peclers Paris Trend BookSS26 Environments & Design Peclers Paris Trend Book
SS26 Environments & Design Peclers Paris Trend Book
 
AIS学位证
AIS学位证AIS学位证
AIS学位证
 
GU degree Cert diploma Transcripta
GU degree Cert diploma Transcripta GU degree Cert diploma Transcripta
GU degree Cert diploma Transcripta
 
一比一原版澳洲圣母大学毕业证(UNDA毕业证书)如何办理
一比一原版澳洲圣母大学毕业证(UNDA毕业证书)如何办理一比一原版澳洲圣母大学毕业证(UNDA毕业证书)如何办理
一比一原版澳洲圣母大学毕业证(UNDA毕业证书)如何办理
 
后入办公室丰满少妇→→(网祉:5j8.net)极品美女口爆←←【(网站:5j8.net)】
后入办公室丰满少妇→→(网祉:5j8.net)极品美女口爆←←【(网站:5j8.net)】后入办公室丰满少妇→→(网祉:5j8.net)极品美女口爆←←【(网站:5j8.net)】
后入办公室丰满少妇→→(网祉:5j8.net)极品美女口爆←←【(网站:5j8.net)】
 
ATAL_Selected_FDPs_AY_2lllllgg024_25.pdf
ATAL_Selected_FDPs_AY_2lllllgg024_25.pdfATAL_Selected_FDPs_AY_2lllllgg024_25.pdf
ATAL_Selected_FDPs_AY_2lllllgg024_25.pdf
 
一比一原版莫纳什大学毕业证(Monash毕业证)如何办理
一比一原版莫纳什大学毕业证(Monash毕业证)如何办理一比一原版莫纳什大学毕业证(Monash毕业证)如何办理
一比一原版莫纳什大学毕业证(Monash毕业证)如何办理
 

Getting Information through HTML Forms

  • 1. webDeV@rgu getting information from users html forms quick tip… THE “SECURITY HACK” AT THE END OFTHIS PRESENTATION IS SOMETHINGTHAT EVERYONE SHOULD KNOW!
  • 2. • HTML Forms • Form Presentation • Form Elements • Input Types • Input Attributes • Form Security Overview
  • 4. • Capturing user input • registering user information • entering username and password for login • posting status updates to social networks • submitting a search query • taking a questionnaire • Transmitting user input elsewhere • send to client side JavaScript for validation • send to server side process (PHP, Java, JavaScript) Purpose of html Forms
  • 7. • The form tag contains all the input elements • <form> … </form> • Input elements can be of <input type=“” /> • Text/password/file or textarea • Radio button or Checkbox • Select boxes • All input elements should be given a form label • Improves accessibility if using a screen reader • <label> … </label> • Fieldsets can be used to graphically group input elements together • <fieldset> … </fieldset> Basic form elements
  • 8. <form> <fieldset> <legend>Please leave a comment...</legend> <label for="name">Name:</label> <input type="text" name="name" value="" /> <label for="email">Email:</label> <input type="text" name="email" value="" /> <label for="comments">Comment:</label> <textarea name="comments" cols="45“ rows="5"> </textarea> <input type="submit" value="Submit" /> </fieldset> </form>
  • 9. • Best practice is to use CSS • However, tables are still used a lot for layout of form elements • better than a messy form Form Presentation
  • 10. <form> <fieldset> <legend>Please leave a comment...</legend> <label for="name">Name:</label> <input type="text" name="name" value="" /> <br> <label for="email">Email:</label> <input type="text" name="email" value="" /> <br> <label for="comments">Comment:</label> <textarea name="comments" cols="45" rows="5"></textarea> <br> <input type="submit" value="Submit" /> </fieldset> </form>
  • 11. <style> input, textarea {width: 400px;} </style> <form> <fieldset> <legend>Please leave a comment...</legend> <table> <tr> <td><label>Name:</label></td> <td><input type="text" name="name" value="" /></td> </tr> <tr> <td><label>Email:</label></td> <td><input type="text" name="email" value="" /></td> </tr> <tr> <td><label>Comment:</label></td> <td><textarea name="comments" cols="45" rows="5"> </textarea></td> </tr> <tr> <td colspan=2><input type="submit" value="Submit" /></td> </tr> </table> </fieldset> </form>
  • 12. Column 1 Column 2 Row 1 Row 2 Row 3 Row 4
  • 13. Form Presentation • Best practice is to use CSS • However, tables are still used a lot for layout of form elements • better than a messy form • Next week we will look at CSS in a lot more detail so that you can get the hang of it.
  • 15. • Provides simple text input text <form> <label for=“firstname>First name:</label><br> <input type="text" name="firstname"><br> Last name:<br> <input type="text" name="lastname"> </form>
  • 16. • Provides text input that is hidden from the user password <form> User name:<br> <input type="text" name="username"><br> User password:<br> <input type="password" name="psw"> </form>
  • 17. <form action="action_page.php"> First name:<br> <input type="text" name="firstname" value="Mike"><br> Last name:<br> <input type="text" name="lastname" value="Crabb"><br><br> <input type="submit" value="Submit"> </form> • Submit button for forms submit
  • 18. <form> Birthday: <input type="date" name="bday"> </form> • The <input type="date"> is used for input fields that should contain a date. date
  • 19. • Provides for a selection of zero or more items from a list of options checkboxes <input type="checkbox" name="pets" value="loveCats">I love cats <br>
 <input type="checkbox" name="pets" value="loveDogs">I love dogs

  • 20. • Provides for only one selection from a list of options Radio buttons <input type="radio" name="cats" value="loveCats">I love cats <br>
 <input type="radio" name="cats" value="hateCats">I have no soul
  • 21. • Choose from a list of options • use the <select> tag • list <options> Selection (drop down) Box <label for="degreeTitle">Degree Title:</label>
 <select name="degreeTitle">
 <option value="cs">Computer Science</option>
 <option value="dm">Digital Media</option>
 <option value="cnmd">Computer Network Management and Design</option </select>
  • 22. • Provides for only one selection from a list of options coloUr <form> Select your favorite color: <input type="color" name="favcolor"> </form>
  • 23. • Provides for only one selection from a list of options email <form> E-mail: <input type="email" name="email"> <input type="submit"> </form>
  • 24. • Provides for only one selection from a list of options URL <form> Add your homepage: <input type="url" name="homepage"> </form>
  • 25. HTML5 form improvements email url Reset color check input is valid email address (something@something.something) check input is valid web address (http://www.something.something) Clears everything on the page Select a colour american spelling
  • 27. • The value attribute specifies the initial value for an input field: value <form action=""> First name:<br> <input type="text" name="firstname" value="John"> <br> Last name:<br> <input type="text" name="lastname"> </form>
  • 28. • The readonly attribute specifies that the input field is read only (cannot be changed) read only <form action=""> First name:<br> <input type="text" name="firstname" value="John" readonly> <br> Last name:<br> <input type="text" name="lastname"> </form>
  • 29. • The disabled attribute specifies that the input field is disabled. • A disabled element is un-usable and un-clickable. • Disabled elements will not be submitted Disabled <form action=""> First name:<br> <input type="text" name="firstname" value="John" disabled> <br> Last name:<br> <input type="text" name="lastname"> </form>
  • 30. • The size attribute specifies the size (in characters) for the input field size <form action=""> First name:<br> <input type="text" name="firstname" value="John" size="40"> <br> Last name:<br> <input type="text" name="lastname"> </form>
  • 31. • The maxlength attribute specifies the maximum allowed length for the input field: maxlength <form action=""> First name:<br> <input type="text" name="firstname" maxlength="10"> <br> Last name:<br> <input type="text" name="lastname"> </form>
  • 32. • The autocomplete attribute specifies whether a form or input field should have autocomplete on or off autocomplete <form autocomplete="on"> First name:<input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br> E-mail: <input type="email" name="email" autocomplete="off"><br> <input type="submit"> </form>
  • 33. placeholder • 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). <input type="text" name="fname" placeholder="First name">
  • 34. required • When present, it 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. Username: <input type="text" name="username" required> This one is important
  • 36. form security • Forms can be quite insecure when we are using them, we need to make sure that the right data is being seen by the right people • and that no-one can get access to the really sensitive data! For example…here’s how to find our a password on an unsecured computer PS - DON’T DO THIS ONE SOMEONE ELSES COMPUTER - YOU’ll GET INTO A LOT OF TROUBLE!!
  • 37. I’ve visited a website and have put in my username and password into the box provided. Let’s say that now I have to step away from my computer for 5 seconds…
  • 38. Some unsavoury character comes along and looks at my screen. They right click on the password field and then go to inspect, I wonder what they are up to?
  • 39. Now they are looking at the HTML for this web page and have an interest in the field that my password is in. It’s ok…its secure (it really isn’t).
  • 40. They change the form element from: <input type=“Password”> to <Input Type=“text”> and now my password is being shown to the world #awkward!
  • 41. • HTML Forms • Form Presentation • Form Elements • Input Types • Input Attributes • Form Security Recap
  • 42. get in touch! @mike_crabb Lecturer in Web Development at Robert Gordon University (Scotland) @rgucomputing Robert Gordon University - School of Computing Science and Digital Media