SlideShare una empresa de Scribd logo
1 de 49
Web Design Principles
5th
Edition
Chapter Eleven
Creating User Input Forms
Objectives
When you complete this chapter, you will be able to:
• Understand how forms work
• Use the <form> element
• Create input objects
• Style forms with Cascading Style Sheets (CSS)
2Web Design Principles 5th
Ed.
Understanding How Forms Work
4
Understanding How Forms Work
• Forms let you build interactive Web pages that
collect information from a user and process it on
the Web server
• The HTML form is the interface for the user to enter
data
• The data is processed by applications that reside
on the Web server
Web Design Principles 5th
Ed.
5
Understanding How Forms Work
• The data-processing software can then work
with the data and send a response back to
the user
• The user enters data via an HTML form
Web Design Principles 5th
Ed.
6Web Design Principles 5th
Ed.
Using the <form> Element
Using the <form> element
• The <form> element is the container for
creating a form
• A variety of attributes describe how the form
data will be processed
8Web Design Principles 5th
Ed.
9Web Design Principles 5th
Ed.
10
Using the <form> element
• The following code shows a typical <form>
element:
<form method="post"
action="https://signup.website.com/register.asp">
Web Design Principles 5th
Ed.
Using get or post
• The difference between get and post is the way the
data is sent to the server
• method=“get”: this method sends the form
information by including it in the URL
• method=“post”: this method sends the form
information securely to the server within the
message body
11Web Design Principles 5th
Ed.
Using the mailto Action
• Lets you collect data from a form and send it to any
e-mail address
<form action="mailto:joel@joelsklar.com"
method="post" enctype="text/plain">
12Web Design Principles 5th
Ed.
Creating Input Objects
14
Creating Input Objects
• The <input> element defines many of the form
input object types
• The type attribute specifies the type of input
object
Web Design Principles 5th
Ed.
15Web Design Principles 5th
Ed.
Labeling Form Elements
• The <label> element lets you create a caption for
an input element
• Lets you extend the clickable area of a form
element
<p>
<label class="username" >First Name:</label>
<input type="text" name="firstname"
size="35" maxlength="35" />
</p>
16Web Design Principles 5th
Ed.
Labeling Form Elements
• To make the text clickable, you associate the
<label> element with the <input> element by using
the for and id attributes
<p>
<label class="username" for="First Name">
First Name:</label>
<input type="text" name="fi rstname" id="First
Name"
size="35" maxlength="35" />
</p>
17Web Design Principles 5th
Ed.
18
Creating Text Boxes
• The text box is the most commonly used form
element
<input type="text" name="firstname"
size="20" maxlength="35" value="First
Name">
Web Design Principles 5th
Ed.
19Web Design Principles 5th
Ed.
20
Creating Check Boxes
• Check boxes are an on/off toggle that the
user can select
<input type="checkbox" name="species"
value="smbass"> Smallmouth Bass
Web Design Principles 5th
Ed.
21Web Design Principles 5th
Ed.
22
Creating Radio Buttons
• Radio buttons are like check boxes, but only
one selection is allowed
<p>Would you like to be on our mailing list?</p>
<p><input type="radio" name="list" value="yes"
id="Yes" />
<label for="Yes">Yes</label>
<input type="radio" name="list" value="no"
id="No" />
<label for="No">No</label>
• </p>
Web Design Principles 5th
Ed.
23Web Design Principles 5th
Ed.
24
Creating Submit & Reset Buttons
• The submit and reset buttons let the user
choose whether to send the form data or start
over
<input type="submit" value="Submit your
answers">
<input type="reset" value="Clear the
form">
Web Design Principles 5th
Ed.
25Web Design Principles 5th
Ed.
26
Creating an Image for the
Submit Button
• You can choose an image file and use it
instead of the default submit button
<input type="image" src="submit.gif"
alt="submit button">
Web Design Principles 5th
Ed.
27Web Design Principles 5th
Ed.
28
Letting the User Submit a File
• Users can select a file on their own computer
and send it to the server
<p>Use the browse button to select your
file:</p>
<p><input type="file" size="30“></p>
Web Design Principles 5th
Ed.
29Web Design Principles 5th
Ed.
30
Creating a Password Entry Field
• The password input box works like the text
input, but the entered text is hidden by
asterisks
<p>Enter your user name and password:</p>
<p>
User Name: <input type="text" size="30" />
Password: <input type="password" size="30" />
</p>
Web Design Principles 5th
Ed.
31Web Design Principles 5th
Ed.
32
Using the <select> Element
• The <select> element lets you create a list
box or scrollable list of selectable options
<select name="boats">
<option>Canoe</option>
<option>Jon Boat</option>
<option>Kayak</option>
<option>Bass Boat</option>
<option>Family Boat</option>
</select>
Web Design Principles 5th
Ed.
33Web Design Principles 5th
Ed.
34
Using the <select> Element
• You can choose to let the user pick multiple
values from the list by adding the multiple
attribute
<select name="snacks" multiple size="6">
<option>Potato Chips</option>
<option>Popcorn</option>
<option>Peanuts</option>
<option>Pretzels</option>
<option>Nachos</option>
<option>Pizza</option>
<option>Fries</option>
</select>
Web Design Principles 5th
Ed.
35Web Design Principles 5th
Ed.
36
Using the <select> Element
• You group and label sets of list options with
the <optgroup> element and label attribute
<optgroup label="Salty Snacks">
<option>Potato Chips</option>
<option>Popcorn</option>
<option>Peanuts</option>
<option>Pretzels</option>
</optgroup>
Web Design Principles 5th
Ed.
37Web Design Principles 5th
Ed.
38
Using the <textarea> Element
• The <textarea> element lets you create a
larger text area for user input
<p><b>Briefly tell us your favorite fish
story:</b><br>
<textarea name="fishstory" rows="5"
cols="30">
Enter your story here...
</textarea>
</p>
Web Design Principles 5th
Ed.
39Web Design Principles 5th
Ed.
40
Creating Input Groupings
• You can use the <fieldset> and <legend>
elements to create groupings of different
types of input elements
Web Design Principles 5th
Ed.
41
Creating Input Groupings
<fieldset>
<legend><b>Select the species you prefer
to fish:</b></legend>
<input type="checkbox" name="species"
value="smbass"> Smallmouth Bass
<input type="checkbox" name="species"
value="lgbass"> Largemouth Bass <br>
<input type="checkbox" name="species"
value="pike"> Pike
</fieldset>
Web Design Principles 5th
Ed.
42Web Design Principles 5th
Ed.
Styling Forms with CSS
44
Styling Forms with CSS
• You can use many of the CSS properties to
specify type styles, background colors, box
properties, and colors to enhance the look of
your forms
• The grouping and labeling elements
<fieldset>, <legend>, and <label> are useful
when applying styles to forms
Web Design Principles 5th
Ed.
45Web Design Principles 5th
Ed.
46Web Design Principles 5th
Ed.
47Web Design Principles 5th
Ed.
48Web Design Principles 5th
Ed.
Summary
• Choose the right form elements based on the data
you want to collect
• A form element has attributes that describe how the
form data is processed
• You need a server application to process your form
data
• The <fieldset> and <legend> elements let you
create more visually appealing forms
• Forms should be formatted to improve their
legibility
49Web Design Principles 5th
Ed.

Más contenido relacionado

La actualidad más candente

Intro to SharePoint 2013 Branding
Intro to SharePoint 2013 BrandingIntro to SharePoint 2013 Branding
Intro to SharePoint 2013 BrandingThomas Daly
 
Web development using ASP.NET MVC
Web development using ASP.NET MVC Web development using ASP.NET MVC
Web development using ASP.NET MVC Adil Mughal
 
SharePoint Saturday Utah 2015 - SP2013 Search Driven Sites
SharePoint Saturday Utah 2015 - SP2013 Search Driven SitesSharePoint Saturday Utah 2015 - SP2013 Search Driven Sites
SharePoint Saturday Utah 2015 - SP2013 Search Driven SitesBrian Culver
 
SharePoint Saturday Kansas 2015 - Building Killer Office365 Public Sites
SharePoint Saturday Kansas 2015 - Building Killer Office365 Public SitesSharePoint Saturday Kansas 2015 - Building Killer Office365 Public Sites
SharePoint Saturday Kansas 2015 - Building Killer Office365 Public SitesBrian Culver
 
Bringing HTML5 alive in SharePoint
Bringing HTML5 alive in SharePointBringing HTML5 alive in SharePoint
Bringing HTML5 alive in SharePointChad Schroeder
 
Building a CSS Architecture for Design Systems
Building a CSS Architecture for Design SystemsBuilding a CSS Architecture for Design Systems
Building a CSS Architecture for Design SystemsChristina Truong
 
Cross Browser Issues - few solutions inspired by smashing magazine
Cross Browser Issues - few solutions inspired by smashing magazineCross Browser Issues - few solutions inspired by smashing magazine
Cross Browser Issues - few solutions inspired by smashing magazinePrabhakaran Mani
 
SharePoint master pages in 2013 and managed metadata magic
SharePoint master pages in 2013 and managed metadata magicSharePoint master pages in 2013 and managed metadata magic
SharePoint master pages in 2013 and managed metadata magicFrancois Pienaar
 
I serve the users
I serve the usersI serve the users
I serve the usersRon Delaney
 
Lightning Bolt for Communities 101
Lightning Bolt for Communities 101Lightning Bolt for Communities 101
Lightning Bolt for Communities 101Salesforce Admins
 

La actualidad más candente (19)

Ppt ch01
Ppt ch01Ppt ch01
Ppt ch01
 
Ppt ch06
Ppt ch06Ppt ch06
Ppt ch06
 
Ppt ch10
Ppt ch10Ppt ch10
Ppt ch10
 
Ppt ch03
Ppt ch03Ppt ch03
Ppt ch03
 
Intro to SharePoint 2013 Branding
Intro to SharePoint 2013 BrandingIntro to SharePoint 2013 Branding
Intro to SharePoint 2013 Branding
 
Joomla! theming
Joomla! themingJoomla! theming
Joomla! theming
 
Ppt ch09
Ppt ch09Ppt ch09
Ppt ch09
 
Ch1
Ch1Ch1
Ch1
 
Module 4 - Dreamweaver Templates (Static vs. Dynamic Content)
Module 4 - Dreamweaver Templates (Static vs. Dynamic Content)Module 4 - Dreamweaver Templates (Static vs. Dynamic Content)
Module 4 - Dreamweaver Templates (Static vs. Dynamic Content)
 
Web development using ASP.NET MVC
Web development using ASP.NET MVC Web development using ASP.NET MVC
Web development using ASP.NET MVC
 
SharePoint Saturday Utah 2015 - SP2013 Search Driven Sites
SharePoint Saturday Utah 2015 - SP2013 Search Driven SitesSharePoint Saturday Utah 2015 - SP2013 Search Driven Sites
SharePoint Saturday Utah 2015 - SP2013 Search Driven Sites
 
SharePoint Saturday Kansas 2015 - Building Killer Office365 Public Sites
SharePoint Saturday Kansas 2015 - Building Killer Office365 Public SitesSharePoint Saturday Kansas 2015 - Building Killer Office365 Public Sites
SharePoint Saturday Kansas 2015 - Building Killer Office365 Public Sites
 
Bringing HTML5 alive in SharePoint
Bringing HTML5 alive in SharePointBringing HTML5 alive in SharePoint
Bringing HTML5 alive in SharePoint
 
Building a CSS Architecture for Design Systems
Building a CSS Architecture for Design SystemsBuilding a CSS Architecture for Design Systems
Building a CSS Architecture for Design Systems
 
Cross Browser Issues - few solutions inspired by smashing magazine
Cross Browser Issues - few solutions inspired by smashing magazineCross Browser Issues - few solutions inspired by smashing magazine
Cross Browser Issues - few solutions inspired by smashing magazine
 
SharePoint master pages in 2013 and managed metadata magic
SharePoint master pages in 2013 and managed metadata magicSharePoint master pages in 2013 and managed metadata magic
SharePoint master pages in 2013 and managed metadata magic
 
Slides bootstrap-4
Slides bootstrap-4Slides bootstrap-4
Slides bootstrap-4
 
I serve the users
I serve the usersI serve the users
I serve the users
 
Lightning Bolt for Communities 101
Lightning Bolt for Communities 101Lightning Bolt for Communities 101
Lightning Bolt for Communities 101
 

Similar a Ppt ch11

9781111528705_PPT_ch11.ppt
9781111528705_PPT_ch11.ppt9781111528705_PPT_ch11.ppt
9781111528705_PPT_ch11.pptSimonChirambira
 
Html5ppt
Html5pptHtml5ppt
Html5pptrecroup
 
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 KompoZerNuzhat Memon
 
06 laboratory exercise 1
06 laboratory exercise 106 laboratory exercise 1
06 laboratory exercise 1Anne Lee
 
Oracle BI Publsiher Using Data Template
Oracle BI Publsiher Using Data TemplateOracle BI Publsiher Using Data Template
Oracle BI Publsiher Using Data TemplateEdi Yanto
 
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 validationMaitree Patel
 
Rotating Banner in SharePoint with a DataView Webpart
Rotating Banner in SharePoint with a DataView WebpartRotating Banner in SharePoint with a DataView Webpart
Rotating Banner in SharePoint with a DataView WebpartEcho Schmidt
 
Creating WordPress Sites in 2 Hours
Creating WordPress Sites in 2 HoursCreating WordPress Sites in 2 Hours
Creating WordPress Sites in 2 HoursSvetlin Nakov
 
9781111528705_PPT_ch04.ppt
9781111528705_PPT_ch04.ppt9781111528705_PPT_ch04.ppt
9781111528705_PPT_ch04.pptSimonChirambira
 
Webform and Drupal 8
Webform and Drupal 8Webform and Drupal 8
Webform and Drupal 8Philip Norton
 
Building Your First Store App with XAML and C#
Building Your First Store App with XAML and C#Building Your First Store App with XAML and C#
Building Your First Store App with XAML and C#Tamir Dresher
 

Similar a Ppt ch11 (20)

9781111528705_PPT_ch11.ppt
9781111528705_PPT_ch11.ppt9781111528705_PPT_ch11.ppt
9781111528705_PPT_ch11.ppt
 
Chapter09
Chapter09Chapter09
Chapter09
 
Frames.ppt
Frames.pptFrames.ppt
Frames.ppt
 
Html forms
Html formsHtml forms
Html forms
 
CSS_Forms.pdf
CSS_Forms.pdfCSS_Forms.pdf
CSS_Forms.pdf
 
Lesson 1
Lesson 1Lesson 1
Lesson 1
 
Html5ppt
Html5pptHtml5ppt
Html5ppt
 
Html5
Html5Html5
Html5
 
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
 
06 laboratory exercise 1
06 laboratory exercise 106 laboratory exercise 1
06 laboratory exercise 1
 
Oracle BI Publsiher Using Data Template
Oracle BI Publsiher Using Data TemplateOracle BI Publsiher Using Data Template
Oracle BI Publsiher Using Data Template
 
Lesson 15
Lesson 15Lesson 15
Lesson 15
 
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
 
Rotating Banner in SharePoint with a DataView Webpart
Rotating Banner in SharePoint with a DataView WebpartRotating Banner in SharePoint with a DataView Webpart
Rotating Banner in SharePoint with a DataView Webpart
 
Ddpz2613 topic6 frame
Ddpz2613 topic6 frameDdpz2613 topic6 frame
Ddpz2613 topic6 frame
 
Asp.Net MVC 5 in Arabic
Asp.Net MVC 5 in ArabicAsp.Net MVC 5 in Arabic
Asp.Net MVC 5 in Arabic
 
Creating WordPress Sites in 2 Hours
Creating WordPress Sites in 2 HoursCreating WordPress Sites in 2 Hours
Creating WordPress Sites in 2 Hours
 
9781111528705_PPT_ch04.ppt
9781111528705_PPT_ch04.ppt9781111528705_PPT_ch04.ppt
9781111528705_PPT_ch04.ppt
 
Webform and Drupal 8
Webform and Drupal 8Webform and Drupal 8
Webform and Drupal 8
 
Building Your First Store App with XAML and C#
Building Your First Store App with XAML and C#Building Your First Store App with XAML and C#
Building Your First Store App with XAML and C#
 

Último

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 

Último (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 

Ppt ch11

  • 1. Web Design Principles 5th Edition Chapter Eleven Creating User Input Forms
  • 2. Objectives When you complete this chapter, you will be able to: • Understand how forms work • Use the <form> element • Create input objects • Style forms with Cascading Style Sheets (CSS) 2Web Design Principles 5th Ed.
  • 4. 4 Understanding How Forms Work • Forms let you build interactive Web pages that collect information from a user and process it on the Web server • The HTML form is the interface for the user to enter data • The data is processed by applications that reside on the Web server Web Design Principles 5th Ed.
  • 5. 5 Understanding How Forms Work • The data-processing software can then work with the data and send a response back to the user • The user enters data via an HTML form Web Design Principles 5th Ed.
  • 8. Using the <form> element • The <form> element is the container for creating a form • A variety of attributes describe how the form data will be processed 8Web Design Principles 5th Ed.
  • 10. 10 Using the <form> element • The following code shows a typical <form> element: <form method="post" action="https://signup.website.com/register.asp"> Web Design Principles 5th Ed.
  • 11. Using get or post • The difference between get and post is the way the data is sent to the server • method=“get”: this method sends the form information by including it in the URL • method=“post”: this method sends the form information securely to the server within the message body 11Web Design Principles 5th Ed.
  • 12. Using the mailto Action • Lets you collect data from a form and send it to any e-mail address <form action="mailto:joel@joelsklar.com" method="post" enctype="text/plain"> 12Web Design Principles 5th Ed.
  • 14. 14 Creating Input Objects • The <input> element defines many of the form input object types • The type attribute specifies the type of input object Web Design Principles 5th Ed.
  • 16. Labeling Form Elements • The <label> element lets you create a caption for an input element • Lets you extend the clickable area of a form element <p> <label class="username" >First Name:</label> <input type="text" name="firstname" size="35" maxlength="35" /> </p> 16Web Design Principles 5th Ed.
  • 17. Labeling Form Elements • To make the text clickable, you associate the <label> element with the <input> element by using the for and id attributes <p> <label class="username" for="First Name"> First Name:</label> <input type="text" name="fi rstname" id="First Name" size="35" maxlength="35" /> </p> 17Web Design Principles 5th Ed.
  • 18. 18 Creating Text Boxes • The text box is the most commonly used form element <input type="text" name="firstname" size="20" maxlength="35" value="First Name"> Web Design Principles 5th Ed.
  • 20. 20 Creating Check Boxes • Check boxes are an on/off toggle that the user can select <input type="checkbox" name="species" value="smbass"> Smallmouth Bass Web Design Principles 5th Ed.
  • 22. 22 Creating Radio Buttons • Radio buttons are like check boxes, but only one selection is allowed <p>Would you like to be on our mailing list?</p> <p><input type="radio" name="list" value="yes" id="Yes" /> <label for="Yes">Yes</label> <input type="radio" name="list" value="no" id="No" /> <label for="No">No</label> • </p> Web Design Principles 5th Ed.
  • 24. 24 Creating Submit & Reset Buttons • The submit and reset buttons let the user choose whether to send the form data or start over <input type="submit" value="Submit your answers"> <input type="reset" value="Clear the form"> Web Design Principles 5th Ed.
  • 26. 26 Creating an Image for the Submit Button • You can choose an image file and use it instead of the default submit button <input type="image" src="submit.gif" alt="submit button"> Web Design Principles 5th Ed.
  • 28. 28 Letting the User Submit a File • Users can select a file on their own computer and send it to the server <p>Use the browse button to select your file:</p> <p><input type="file" size="30“></p> Web Design Principles 5th Ed.
  • 30. 30 Creating a Password Entry Field • The password input box works like the text input, but the entered text is hidden by asterisks <p>Enter your user name and password:</p> <p> User Name: <input type="text" size="30" /> Password: <input type="password" size="30" /> </p> Web Design Principles 5th Ed.
  • 32. 32 Using the <select> Element • The <select> element lets you create a list box or scrollable list of selectable options <select name="boats"> <option>Canoe</option> <option>Jon Boat</option> <option>Kayak</option> <option>Bass Boat</option> <option>Family Boat</option> </select> Web Design Principles 5th Ed.
  • 34. 34 Using the <select> Element • You can choose to let the user pick multiple values from the list by adding the multiple attribute <select name="snacks" multiple size="6"> <option>Potato Chips</option> <option>Popcorn</option> <option>Peanuts</option> <option>Pretzels</option> <option>Nachos</option> <option>Pizza</option> <option>Fries</option> </select> Web Design Principles 5th Ed.
  • 36. 36 Using the <select> Element • You group and label sets of list options with the <optgroup> element and label attribute <optgroup label="Salty Snacks"> <option>Potato Chips</option> <option>Popcorn</option> <option>Peanuts</option> <option>Pretzels</option> </optgroup> Web Design Principles 5th Ed.
  • 38. 38 Using the <textarea> Element • The <textarea> element lets you create a larger text area for user input <p><b>Briefly tell us your favorite fish story:</b><br> <textarea name="fishstory" rows="5" cols="30"> Enter your story here... </textarea> </p> Web Design Principles 5th Ed.
  • 40. 40 Creating Input Groupings • You can use the <fieldset> and <legend> elements to create groupings of different types of input elements Web Design Principles 5th Ed.
  • 41. 41 Creating Input Groupings <fieldset> <legend><b>Select the species you prefer to fish:</b></legend> <input type="checkbox" name="species" value="smbass"> Smallmouth Bass <input type="checkbox" name="species" value="lgbass"> Largemouth Bass <br> <input type="checkbox" name="species" value="pike"> Pike </fieldset> Web Design Principles 5th Ed.
  • 44. 44 Styling Forms with CSS • You can use many of the CSS properties to specify type styles, background colors, box properties, and colors to enhance the look of your forms • The grouping and labeling elements <fieldset>, <legend>, and <label> are useful when applying styles to forms Web Design Principles 5th Ed.
  • 49. Summary • Choose the right form elements based on the data you want to collect • A form element has attributes that describe how the form data is processed • You need a server application to process your form data • The <fieldset> and <legend> elements let you create more visually appealing forms • Forms should be formatted to improve their legibility 49Web Design Principles 5th Ed.