Getting Information through HTML Forms

Mike Crabb
Mike CrabbLecturer at University of Dundee em University of Dundee
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="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
<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="">
First name:<br>
<input type="text" name="firstname" value="John">
<br>
Last name:<br>
<input type="text" name="lastname">
</form>
• 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>
• 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>
• 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>
• 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>
• 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
1 de 42

Recomendados

Website Proposal PowerPoint Presentation Slides por
Website Proposal PowerPoint Presentation Slides Website Proposal PowerPoint Presentation Slides
Website Proposal PowerPoint Presentation Slides SlideTeam
866 visualizações35 slides
User Persona por
User PersonaUser Persona
User PersonaDiane Leeper
3.6K visualizações36 slides
The SaaS business model por
The SaaS business modelThe SaaS business model
The SaaS business modelDavid Skok
179.4K visualizações54 slides
From 500 Startups to 500 VCs por
From 500 Startups to 500 VCsFrom 500 Startups to 500 VCs
From 500 Startups to 500 VCsDave McClure
83.6K visualizações45 slides
The R&D Behind Your Elevator Pitch por
The R&D Behind Your Elevator PitchThe R&D Behind Your Elevator Pitch
The R&D Behind Your Elevator PitchKelly Services
19.8K visualizações26 slides
Transforming Accessibility one lunch at a tiime - CSUN 2023 por
Transforming Accessibility one lunch at a tiime - CSUN 2023Transforming Accessibility one lunch at a tiime - CSUN 2023
Transforming Accessibility one lunch at a tiime - CSUN 2023Ted Drake
185 visualizações29 slides

Mais conteúdo relacionado

Mais procurados

The History of SEO por
The History of SEOThe History of SEO
The History of SEOHubSpot
5M visualizações101 slides
Startup Metrics for Pirates por
Startup Metrics for PiratesStartup Metrics for Pirates
Startup Metrics for PiratesDave McClure
1.2M visualizações20 slides
Lead Nurturing with Marketo por
Lead Nurturing with MarketoLead Nurturing with Marketo
Lead Nurturing with MarketoJosh Hill
10.2K visualizações55 slides
Search Content vs. Social Content por
Search Content vs. Social ContentSearch Content vs. Social Content
Search Content vs. Social ContentSemrush
355.5K visualizações48 slides
UI/UX Fundamentals por
UI/UX FundamentalsUI/UX Fundamentals
UI/UX FundamentalsDijup Tuladhar
2.3K visualizações50 slides
[500DISTRO] The Scientific Method: How to Design & Track Viral Growth Experim... por
[500DISTRO] The Scientific Method: How to Design & Track Viral Growth Experim...[500DISTRO] The Scientific Method: How to Design & Track Viral Growth Experim...
[500DISTRO] The Scientific Method: How to Design & Track Viral Growth Experim...500 Startups
189.5K visualizações52 slides

Mais procurados(20)

The History of SEO por HubSpot
The History of SEOThe History of SEO
The History of SEO
HubSpot5M visualizações
Startup Metrics for Pirates por Dave McClure
Startup Metrics for PiratesStartup Metrics for Pirates
Startup Metrics for Pirates
Dave McClure1.2M visualizações
Lead Nurturing with Marketo por Josh Hill
Lead Nurturing with MarketoLead Nurturing with Marketo
Lead Nurturing with Marketo
Josh Hill10.2K visualizações
Search Content vs. Social Content por Semrush
Search Content vs. Social ContentSearch Content vs. Social Content
Search Content vs. Social Content
Semrush355.5K visualizações
UI/UX Fundamentals por Dijup Tuladhar
UI/UX FundamentalsUI/UX Fundamentals
UI/UX Fundamentals
Dijup Tuladhar2.3K visualizações
[500DISTRO] The Scientific Method: How to Design & Track Viral Growth Experim... por 500 Startups
[500DISTRO] The Scientific Method: How to Design & Track Viral Growth Experim...[500DISTRO] The Scientific Method: How to Design & Track Viral Growth Experim...
[500DISTRO] The Scientific Method: How to Design & Track Viral Growth Experim...
500 Startups189.5K visualizações
UX & UI Design: Differentiate through design por MoodLabs
UX & UI Design: Differentiate through designUX & UI Design: Differentiate through design
UX & UI Design: Differentiate through design
MoodLabs1.7K visualizações
Five Killer Ways to Design The Same Slide por Crispy Presentations
Five Killer Ways to Design The Same SlideFive Killer Ways to Design The Same Slide
Five Killer Ways to Design The Same Slide
Crispy Presentations3.8M visualizações
17 Ways to Design a Presentation People Want to View por Jim MacLeod
17 Ways to Design a Presentation People Want to View17 Ways to Design a Presentation People Want to View
17 Ways to Design a Presentation People Want to View
Jim MacLeod91.3K visualizações
32 Ways a Digital Marketing Consultant Can Help Grow Your Business por Barry Feldman
32 Ways a Digital Marketing Consultant Can Help Grow Your Business32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
Barry Feldman340.1K visualizações
E Commerce Website Design Proposal PowerPoint Presentation Slides por SlideTeam
E Commerce Website Design Proposal PowerPoint Presentation SlidesE Commerce Website Design Proposal PowerPoint Presentation Slides
E Commerce Website Design Proposal PowerPoint Presentation Slides
SlideTeam400 visualizações
10 Million Uploads: Our Favorites por SlideShare
10 Million Uploads: Our Favorites10 Million Uploads: Our Favorites
10 Million Uploads: Our Favorites
SlideShare17.5M visualizações
10 Insightful Quotes On Designing A Better Customer Experience por Yuan Wang
10 Insightful Quotes On Designing A Better Customer Experience10 Insightful Quotes On Designing A Better Customer Experience
10 Insightful Quotes On Designing A Better Customer Experience
Yuan Wang1.3M visualizações
UX Lesson 2: User Research por Joan Lumanauw
UX Lesson 2: User ResearchUX Lesson 2: User Research
UX Lesson 2: User Research
Joan Lumanauw7.6K visualizações
Here’s The Deck Andy Raskin Called “The Greatest Sales Pitch I’ve Seen All Year” por Drift
Here’s The Deck Andy Raskin Called “The Greatest Sales Pitch I’ve Seen All Year”Here’s The Deck Andy Raskin Called “The Greatest Sales Pitch I’ve Seen All Year”
Here’s The Deck Andy Raskin Called “The Greatest Sales Pitch I’ve Seen All Year”
Drift637.7K visualizações
How to Use Grammarly por Reginald Wadwadan
How to Use GrammarlyHow to Use Grammarly
How to Use Grammarly
Reginald Wadwadan830 visualizações
DESIGN THE PRIORITY, PERFORMANCE 
AND UX por Peter Rozek
DESIGN THE PRIORITY, PERFORMANCE 
AND UXDESIGN THE PRIORITY, PERFORMANCE 
AND UX
DESIGN THE PRIORITY, PERFORMANCE 
AND UX
Peter Rozek25.2K visualizações
Step 3: How To Write Your Content por RealFreeWebsites.com
Step 3: How To Write Your ContentStep 3: How To Write Your Content
Step 3: How To Write Your Content
RealFreeWebsites.com5K visualizações
#GrowthDeck - Andrew Chen AMA by GrowthHackers por GrowthHackers
#GrowthDeck - Andrew Chen AMA by GrowthHackers#GrowthDeck - Andrew Chen AMA by GrowthHackers
#GrowthDeck - Andrew Chen AMA by GrowthHackers
GrowthHackers31.9K visualizações
UX design por Tanay Kumar
UX designUX design
UX design
Tanay Kumar4.3K visualizações

Destaque

Montreal Girl Geeks: Building the Modern Web por
Montreal Girl Geeks: Building the Modern WebMontreal Girl Geeks: Building the Modern Web
Montreal Girl Geeks: Building the Modern WebRachel Andrew
254K visualizações124 slides
Internet of Things - The Tip of an Iceberg por
Internet of Things - The Tip of an IcebergInternet of Things - The Tip of an Iceberg
Internet of Things - The Tip of an IcebergDr. Mazlan Abbas
50.5K visualizações86 slides
Introduction to Development for the Internet por
Introduction to Development for the InternetIntroduction to Development for the Internet
Introduction to Development for the InternetMike Crabb
101.6K visualizações22 slides
Node.js and The Internet of Things por
Node.js and The Internet of ThingsNode.js and The Internet of Things
Node.js and The Internet of ThingsLosant
142.7K visualizações31 slides
Finding Our Happy Place in the Internet of Things por
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 ThingsPamela Pavliscak
74.6K visualizações42 slides
Build Features, Not Apps por
Build Features, Not AppsBuild Features, Not Apps
Build Features, Not AppsNatasha Murashev
389K visualizações60 slides

Destaque(20)

Montreal Girl Geeks: Building the Modern Web por Rachel Andrew
Montreal Girl Geeks: Building the Modern WebMontreal Girl Geeks: Building the Modern Web
Montreal Girl Geeks: Building the Modern Web
Rachel Andrew254K visualizações
Internet of Things - The Tip of an Iceberg por Dr. Mazlan Abbas
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 Abbas50.5K visualizações
Introduction to Development for the Internet por Mike Crabb
Introduction to Development for the InternetIntroduction to Development for the Internet
Introduction to Development for the Internet
Mike Crabb101.6K visualizações
Node.js and The Internet of Things por Losant
Node.js and The Internet of ThingsNode.js and The Internet of Things
Node.js and The Internet of Things
Losant142.7K visualizações
Finding Our Happy Place in the Internet of Things por Pamela Pavliscak
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 Pavliscak74.6K visualizações
Build Features, Not Apps por Natasha Murashev
Build Features, Not AppsBuild Features, Not Apps
Build Features, Not Apps
Natasha Murashev389K visualizações
Valentine's Day por Ingenico ePayments
Valentine's DayValentine's Day
Valentine's Day
Ingenico ePayments53.1K visualizações
Health and Well-Being on the Social Web por ron mader
Health and Well-Being on the Social WebHealth and Well-Being on the Social Web
Health and Well-Being on the Social Web
ron mader18.7K visualizações
How Much Further Will Internet Stocks Fall? (Share Price Performance) por Mahesh Vellanki
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 Vellanki28.5K visualizações
Net neutrality: The Basics por InterQuest Group
Net neutrality: The BasicsNet neutrality: The Basics
Net neutrality: The Basics
InterQuest Group38.3K visualizações
Visual Design with Data por Seth Familian
Visual Design with DataVisual Design with Data
Visual Design with Data
Seth Familian2.9M visualizações
25 Festive Fonts For Women Oriented Businesses! por DesignMantic
25 Festive Fonts For Women Oriented Businesses!25 Festive Fonts For Women Oriented Businesses!
25 Festive Fonts For Women Oriented Businesses!
DesignMantic29.9K visualizações
Designing Teams for Emerging Challenges por Aaron Irizarry
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging Challenges
Aaron Irizarry1.1M visualizações
Study: The Future of VR, AR and Self-Driving Cars por LinkedIn
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
LinkedIn870.6K visualizações
Mobile-First SEO - The Marketers Edition #3XEDigital por Aleyda Solís
Mobile-First SEO - The Marketers Edition #3XEDigitalMobile-First SEO - The Marketers Edition #3XEDigital
Mobile-First SEO - The Marketers Edition #3XEDigital
Aleyda Solís471.4K visualizações
Mobile Is Eating the World (2016) por a16z
Mobile Is Eating the World (2016)Mobile Is Eating the World (2016)
Mobile Is Eating the World (2016)
a16z1.7M visualizações
UX, ethnography and possibilities: for Libraries, Museums and Archives por Ned Potter
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 Potter1M visualizações
IT in Healthcare por NetApp
IT in HealthcareIT in Healthcare
IT in Healthcare
NetApp69.5K visualizações
How to Become a Thought Leader in Your Niche por Leslie Samuel
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
Leslie Samuel1.6M visualizações

Similar a Getting Information through HTML Forms

Html tables, forms and audio video por
Html tables, forms and audio videoHtml tables, forms and audio video
Html tables, forms and audio videoSaad Sheikh
1.4K visualizações41 slides
Web forms and html (lect 4) por
Web forms and html (lect 4)Web forms and html (lect 4)
Web forms and html (lect 4)Salman Memon
232 visualizações17 slides
Form using html and java script validation por
Form using html and java script validationForm using html and java script validation
Form using html and java script validationMaitree Patel
1.4K visualizações30 slides
Forms por
FormsForms
Formsmyrajendra
825 visualizações8 slides
Html forms por
Html formsHtml forms
Html formsHimanshu Pathak
622 visualizações18 slides
htmlcss.pdf por
htmlcss.pdfhtmlcss.pdf
htmlcss.pdfElieMambou1
11 visualizações57 slides

Similar a Getting Information through HTML Forms(20)

Html tables, forms and audio video por Saad Sheikh
Html tables, forms and audio videoHtml tables, forms and audio video
Html tables, forms and audio video
Saad Sheikh1.4K visualizações
Web forms and html (lect 4) por Salman Memon
Web forms and html (lect 4)Web forms and html (lect 4)
Web forms and html (lect 4)
Salman Memon232 visualizações
Form using html and java script validation por Maitree Patel
Form using html and java script validationForm using html and java script validation
Form using html and java script validation
Maitree Patel1.4K visualizações
Forms por myrajendra
FormsForms
Forms
myrajendra825 visualizações
Html forms por Himanshu Pathak
Html formsHtml forms
Html forms
Himanshu Pathak622 visualizações
htmlcss.pdf por ElieMambou1
htmlcss.pdfhtmlcss.pdf
htmlcss.pdf
ElieMambou111 visualizações
Html forms por nobel mujuji
Html formsHtml forms
Html forms
nobel mujuji5.7K visualizações
Web engineering - HTML Form por Nosheen Qamar
Web engineering -  HTML FormWeb engineering -  HTML Form
Web engineering - HTML Form
Nosheen Qamar1.6K visualizações
HTML5 - Forms por tina1357
HTML5 - FormsHTML5 - Forms
HTML5 - Forms
tina13571.5K visualizações
Forms Part 1 por kjkleindorfer
Forms Part 1Forms Part 1
Forms Part 1
kjkleindorfer2.2K visualizações
Unit 2 (it workshop) por Dr.Lokesh Gagnani
Unit 2 (it workshop)Unit 2 (it workshop)
Unit 2 (it workshop)
Dr.Lokesh Gagnani42 visualizações
FormL13.pptx por serd4
FormL13.pptxFormL13.pptx
FormL13.pptx
serd42 visualizações
Chapter 9: Forms por Steve Guinan
Chapter 9: FormsChapter 9: Forms
Chapter 9: Forms
Steve Guinan163 visualizações
uptu web technology unit 2 html por Abhishek Kesharwani
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 html
Abhishek Kesharwani564 visualizações
Lesson 15 por Gene Babon
Lesson 15Lesson 15
Lesson 15
Gene Babon281 visualizações
INTRODUCTION TO HTML & CSS .pptx por SarthakrOkr
INTRODUCTION TO HTML & CSS .pptxINTRODUCTION TO HTML & CSS .pptx
INTRODUCTION TO HTML & CSS .pptx
SarthakrOkr22 visualizações
HTML 5 Simple Tutorial Part 4 por Sanjeev Kumar
HTML 5 Simple Tutorial Part 4HTML 5 Simple Tutorial Part 4
HTML 5 Simple Tutorial Part 4
Sanjeev Kumar128 visualizações
18servers And Forms por Adil Jafri
18servers And Forms18servers And Forms
18servers And Forms
Adil Jafri187 visualizações

Mais de Mike Crabb

Hard to Reach Users in Easy to Reach Places por
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 PlacesMike Crabb
1.1K visualizações47 slides
Accessible and Assistive Interfaces por
Accessible and Assistive InterfacesAccessible and Assistive Interfaces
Accessible and Assistive InterfacesMike Crabb
692 visualizações18 slides
Accessible Everyone por
Accessible EveryoneAccessible Everyone
Accessible EveryoneMike Crabb
1.4K visualizações89 slides
The Peer Review Process por
The Peer Review ProcessThe Peer Review Process
The Peer Review ProcessMike Crabb
1.8K visualizações36 slides
Managing Quality In Qualitative Research por
Managing Quality In Qualitative ResearchManaging Quality In Qualitative Research
Managing Quality In Qualitative ResearchMike Crabb
1.6K visualizações62 slides
Analysing Qualitative Data por
Analysing Qualitative DataAnalysing Qualitative Data
Analysing Qualitative DataMike Crabb
818 visualizações59 slides

Mais de Mike Crabb(20)

Hard to Reach Users in Easy to Reach Places por Mike Crabb
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 Crabb1.1K visualizações
Accessible and Assistive Interfaces por Mike Crabb
Accessible and Assistive InterfacesAccessible and Assistive Interfaces
Accessible and Assistive Interfaces
Mike Crabb692 visualizações
Accessible Everyone por Mike Crabb
Accessible EveryoneAccessible Everyone
Accessible Everyone
Mike Crabb1.4K visualizações
The Peer Review Process por Mike Crabb
The Peer Review ProcessThe Peer Review Process
The Peer Review Process
Mike Crabb1.8K visualizações
Managing Quality In Qualitative Research por Mike Crabb
Managing Quality In Qualitative ResearchManaging Quality In Qualitative Research
Managing Quality In Qualitative Research
Mike Crabb1.6K visualizações
Analysing Qualitative Data por Mike Crabb
Analysing Qualitative DataAnalysing Qualitative Data
Analysing Qualitative Data
Mike Crabb818 visualizações
Conversation Discourse and Document Analysis por Mike Crabb
Conversation Discourse and Document AnalysisConversation Discourse and Document Analysis
Conversation Discourse and Document Analysis
Mike Crabb479 visualizações
Ethnographic and Observational Research por Mike Crabb
Ethnographic and Observational ResearchEthnographic and Observational Research
Ethnographic and Observational Research
Mike Crabb621 visualizações
Doing Focus Groups por Mike Crabb
Doing Focus GroupsDoing Focus Groups
Doing Focus Groups
Mike Crabb345 visualizações
Doing Interviews por Mike Crabb
Doing InterviewsDoing Interviews
Doing Interviews
Mike Crabb280 visualizações
Designing Qualitative Research por Mike Crabb
Designing Qualitative ResearchDesigning Qualitative Research
Designing Qualitative Research
Mike Crabb418 visualizações
Introduction to Accessible Design por Mike Crabb
Introduction to Accessible DesignIntroduction to Accessible Design
Introduction to Accessible Design
Mike Crabb177 visualizações
Accessible Everyone por Mike Crabb
Accessible EveryoneAccessible Everyone
Accessible Everyone
Mike Crabb1.9K visualizações
Texture and Glyph Design por Mike Crabb
Texture and Glyph DesignTexture and Glyph Design
Texture and Glyph Design
Mike Crabb5.4K visualizações
Pattern Perception and Map Design por Mike Crabb
Pattern Perception and Map DesignPattern Perception and Map Design
Pattern Perception and Map Design
Mike Crabb404 visualizações
Dealing with Enterprise Level Data por Mike Crabb
Dealing with Enterprise Level DataDealing with Enterprise Level Data
Dealing with Enterprise Level Data
Mike Crabb1.1K visualizações
Using Cloud in an Enterprise Environment por Mike Crabb
Using Cloud in an Enterprise EnvironmentUsing Cloud in an Enterprise Environment
Using Cloud in an Enterprise Environment
Mike Crabb2.3K visualizações
Teaching Cloud to the Programmers of Tomorrow por Mike Crabb
Teaching Cloud to the Programmers of TomorrowTeaching Cloud to the Programmers of Tomorrow
Teaching Cloud to the Programmers of Tomorrow
Mike Crabb5.6K visualizações
Sql Injection and XSS por Mike Crabb
Sql Injection and XSSSql Injection and XSS
Sql Injection and XSS
Mike Crabb3.3K visualizações
Forms and Databases in PHP por Mike Crabb
Forms and Databases in PHPForms and Databases in PHP
Forms and Databases in PHP
Mike Crabb1.8K visualizações

Último

DR Portfolio.pptx por
DR Portfolio.pptxDR Portfolio.pptx
DR Portfolio.pptxrobertsd2
25 visualizações11 slides
Office furniture por
Office furnitureOffice furniture
Office furnitureCreaticityBrandedint
5 visualizações1 slide
Samsung Galaxy Watch 5 Presentation por
Samsung Galaxy Watch 5 PresentationSamsung Galaxy Watch 5 Presentation
Samsung Galaxy Watch 5 Presentationaryasheel1
13 visualizações1 slide
Final (1).pdf por
Final (1).pdfFinal (1).pdf
Final (1).pdfkarmadjango
9 visualizações188 slides
boggiano_project 2.pptx por
boggiano_project 2.pptxboggiano_project 2.pptx
boggiano_project 2.pptxsamboggiano
24 visualizações8 slides
Essay 29.docx por
Essay 29.docxEssay 29.docx
Essay 29.docxOrlySiquihua
9 visualizações1 slide

Último(20)

DR Portfolio.pptx por robertsd2
DR Portfolio.pptxDR Portfolio.pptx
DR Portfolio.pptx
robertsd225 visualizações
Samsung Galaxy Watch 5 Presentation por aryasheel1
Samsung Galaxy Watch 5 PresentationSamsung Galaxy Watch 5 Presentation
Samsung Galaxy Watch 5 Presentation
aryasheel113 visualizações
Final (1).pdf por karmadjango
Final (1).pdfFinal (1).pdf
Final (1).pdf
karmadjango9 visualizações
boggiano_project 2.pptx por samboggiano
boggiano_project 2.pptxboggiano_project 2.pptx
boggiano_project 2.pptx
samboggiano24 visualizações
Essay 29.docx por OrlySiquihua
Essay 29.docxEssay 29.docx
Essay 29.docx
OrlySiquihua9 visualizações
ATPMOUSE_융합2조.pptx por kts120898
ATPMOUSE_융합2조.pptxATPMOUSE_융합2조.pptx
ATPMOUSE_융합2조.pptx
kts12089825 visualizações
BeatsFest Brand Guidelines Final.pdf por EddiePena9
BeatsFest Brand Guidelines Final.pdfBeatsFest Brand Guidelines Final.pdf
BeatsFest Brand Guidelines Final.pdf
EddiePena98 visualizações
Sugar Air Kiss Lipstick por aryasheel1
Sugar Air Kiss LipstickSugar Air Kiss Lipstick
Sugar Air Kiss Lipstick
aryasheel111 visualizações
500% Sales Growth with Amazon A+ Content por Fahima
500% Sales Growth with Amazon A+ Content500% Sales Growth with Amazon A+ Content
500% Sales Growth with Amazon A+ Content
Fahima11 visualizações
Legal PPT Presentation.pptx por 125071063
Legal PPT Presentation.pptxLegal PPT Presentation.pptx
Legal PPT Presentation.pptx
1250710635 visualizações
Cocktail Merchandise por nyhapedraza
Cocktail MerchandiseCocktail Merchandise
Cocktail Merchandise
nyhapedraza35 visualizações
Using Experiential Design to Understand the Future of AI & Immersive Storytel... por Kent Bye
Using Experiential Design to Understand the Future of AI & Immersive Storytel...Using Experiential Design to Understand the Future of AI & Immersive Storytel...
Using Experiential Design to Understand the Future of AI & Immersive Storytel...
Kent Bye20 visualizações
JAWARK Inside Company Profile 2024 por mostafareda1994
JAWARK Inside Company Profile 2024JAWARK Inside Company Profile 2024
JAWARK Inside Company Profile 2024
mostafareda199412 visualizações
Sudden Deafness Design Document por wyfangherman
Sudden Deafness Design DocumentSudden Deafness Design Document
Sudden Deafness Design Document
wyfangherman54 visualizações
Indian wedding dresses design.pdf por Aur Dikhao
Indian wedding dresses design.pdfIndian wedding dresses design.pdf
Indian wedding dresses design.pdf
Aur Dikhao5 visualizações
Business X Design - People, Planet & Product por Cyber-Duck
Business X Design - People, Planet & ProductBusiness X Design - People, Planet & Product
Business X Design - People, Planet & Product
Cyber-Duck28 visualizações
Oral presntation.pptx por saraalzarouni121
Oral presntation.pptxOral presntation.pptx
Oral presntation.pptx
saraalzarouni1218 visualizações
Subzero Report (1).pdf por sidhantkhanna8
Subzero Report (1).pdfSubzero Report (1).pdf
Subzero Report (1).pdf
sidhantkhanna811 visualizações
EL FODA.pdf por estefanimilenca
EL FODA.pdfEL FODA.pdf
EL FODA.pdf
estefanimilenca22 visualizações

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