Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.

Slides:



Advertisements
Similar presentations
Tutorial 6 Creating a Web Form
Advertisements

Chapter 6 Basic forms 1. Forms and query string 2 form : a group of user input (UI) controls that accepts information from the user and sends the information.
XP 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
Creating Web Page Forms. Objectives Describe how Web forms can interact with a server-based program Insert a form into a Web page Create and format a.
Tutorial 6 Working with Web Forms
Forms Review. 2 Using Forms tag  Contains the form elements on a web page  Container tag tag  Configures a variety of form elements including text.
Forms Describe common uses of forms on web pages
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
Using Entities & Creating Forms Jill R. Sommer Institute for Applied Linguistics Kent State University.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Chapter 10 Form Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Tutorial #9 – Creating Forms. Tutorial #8 Review – Tables Borders (table, gridlines), Border-collapse: collapse; empty-cells: show; and rowspan, colspan.
4-Sep-15 HTML Forms Mrs. Goins Web Design Class. Parts of a Web Form A Form is an area that can contain Form Control/Elements. Each piece of information.
CIS 1310 – HTML & CSS 9 Forms. CIS 1310 – HTML & CSS Learning Outcomes  Describe Common Uses of Forms on Web Pages  Create Forms on Web Pages  Associate.
XP Tutorial 6New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Creating Web Page Forms Designing a Product Registration Form Tutorial.
XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
1 Creating Web Forms in HTML Web forms collect information from customers Web forms include different control elements including: –Input boxes –Selection.
Forms and Form Controls Chapter What is a Form?
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
© 2011 Delmar, Cengage Learning Chapter 9 Collecting Data with Forms.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
Tables and Forms HTML5 Tables and Forms. Table Overview table element ( ) Attributes: align (left, right, center), bgcolor, border, cellpadding, cellspacing,
Basics of Web Design 1 Copyright © 2016 Pearson Education, Inc., Hoboken NJ.
CSC 2720 Building Web Applications HTML Forms. Introduction  HTML forms are used to collect user input.  The collected input is typically sent to a.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
HTML Forms.
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
Week 9 - Form Basics Key Concepts 1. 1.Describe common uses of forms on web pages 2.Create forms on web pages using the form, input, textarea, and select.
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
Creating Web Page Forms. Introducing Web Forms Web forms collect information from users Web forms include different control elements including: –Input.
1 HTML Forms
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
HTML Forms a form is a container for input elements on a web page input elements contain data that is sent to the web server for processing.
Copyright © Terry Felke-Morris HTML5: TEXT BOX Accepts text information in address format Common Attributes: ◦ type=“ ” ◦ name ◦ id ◦
SYST Web Technologies SYST Web Technologies XHTML Forms.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
+ FORMS HTML forms are used to pass data to a server. begins and ends a form Forms are made up of input elements Every input element has a name and value.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
HTML Forms.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Project 6: Creating XHTML Forms Kelly.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
expanded by J. Goetz, © Pearson Education Copyright (c) 2006 Prentice-Hall. All rights reserved.
Tutorial 6 Creating a Web Form
HTML III (Forms) Robin Burke ECT 270. Outline Where we are in this class Web applications HTML Forms Break Forms lab.
XP Tutorial 6New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
2440: 141 Web Site Administration Web Forms Instructor: Joseph Nattey.
Tutorial 6 Working with Web Forms
Chapter 5 Validating Form Data with JavaScript
How to Write Web Forms By Mimi Opkins.
Web Development & Design Foundations with HTML5 8th Edition
ITE 115 Creating Web Page Forms
Web Development & Design Foundations with HTML5 8th Edition
Designing Forms Lesson 10.
Web Development & Design Foundations with H T M L 5
CNIT 131 HTML5 - Forms.
Web Development & Design Foundations with H T M L 5
Basics of Web Design Chapter 10 Form Basics Key Concepts
Lesson 6: Web Forms.
Presentation transcript:

Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris

LEARNING OUTCOMES  In this chapter, you will learn how to...  Describe common uses of forms on web pages  Create forms on web pages using the form, input, textarea, and select elements  Create forms that provide additional accessibility features using the accesskey and tabindex attributes  Associate form controls and groups using the label, fieldset, and legend elements  Create custom image buttons and use the button element  Use CSS to style a form  Configure new HTML5 form controls including the , URL, datalist, range, spinner, calendar, and color controls  Describe the features and common uses of server-side processing  Invoke server-side processing to handle form data  Find free server-side processing resources on the Web 2

Copyright © Terry Felke-Morris OVERVIEW OF FORMS  Forms are used all over the Web to  Accept information  Provide interactivity  Types of forms:  Search form, Order form, Newsletter sign-up form, Survey form, Add to Cart form, and so on… 3

Copyright © Terry Felke-Morris OVERVIEW OF FORMS (2)  Form  An HTML element that contains and organizes  form controls such as text boxes, check boxes, and buttons that can accept information from website visitors. 4

Copyright © Terry Felke-Morris TWO COMPONENTS OF USING FORMS 1. The HTML form the web page user interface and 2. The server-side processing Server-side processing works with the form data and sends , writes to a text file, updates a database, or performs some other type of processing on the server. 5

Copyright © Terry Felke-Morris HTML USING FORMS 6   Contains the form elements on a web page  Container tag   Configures a variety of form elements including text boxes, radio buttons, check boxes, and buttons  Stand alone tag   Configures a scrolling text box  Container tag   Configures a select box (drop down list)  Container tag   Configures an option in the select box  Container tag

Copyright © Terry Felke-Morris SAMPLE FORM HTML 7

Copyright © Terry Felke-Morris HTML FORM ELEMENT The form element attributes: ◦ action  Specifies the server-side program or script that will process your form data ◦ method  get – default value, form data passed in URL  post – more secure, form data passed in HTTP Entity Body ◦ name  Identifies the form ◦ id  Identifies the form 8

Copyright © Terry Felke-Morris INPUT TEXT BOX Accepts text information Attributes: ◦ type=“text” ◦ name ◦ id ◦ size ◦ maxlength ◦ value 9

Copyright © Terry Felke-Morris TEXTAREA SCROLLING TEXT BOX   Configures a scrolling text box  Attributes:  name  id  cols  rows 10

Copyright © Terry Felke-Morris INPUT SUBMIT BUTTON   Submits the form information  When clicked:  Triggers the action method on the tag  Sends the form data (the name=value pair for each form element) to the web server.  Attributes:  type=“submit”  name  id  value 11

Copyright © Terry Felke-Morris INPUT RESET BUTTON   Resets the form fields to their initial values  Attributes:  type=“reset”  name  id  value 12

Copyright © Terry Felke-Morris HANDS-ON PRACTICE 13

Copyright © Terry Felke-Morris INPUT PASSWORD BOX Accepts text information that needs to be hidden as it is entered Attributes: ◦ type=“password” ◦ name ◦ id ◦ size ◦ maxlength ◦ value 14

Copyright © Terry Felke-Morris INPUT CHECK BOX Allows the user to select one or more of a group of predetermined items Attributes: ◦ type=“checkbox” ◦ name ◦ id ◦ checked ◦ value 1

Copyright © Terry Felke-Morris INPUT RADIO BUTTON Allows the user to select exactly one from a group of predetermined items Each radio button in a group is given the same name and a unique value Attributes: ◦ type=“radio” ◦ name ◦ id ◦ checked ◦ value 16

Copyright © Terry Felke-Morris INPUT HIDDEN FORM DATA   This form control is not displayed on the web page.  Hidden form fields  Can be accessed by both client-side and server-side scripting  Sometimes used to contain information needed as the visitor moves from page to page.  Attributes:  type=“hidden”  name  id  value 17

Copyright © Terry Felke-Morris SELECT LIST Configures a select list (along with option elements) Also known as: Select Box, Drop-Down List, Drop- Down Box, and Option Box. Allows the user to select one or more items from a list of predetermined choices. Attributes: ◦ name ◦ id ◦ size ◦ multiple 18

Copyright © Terry Felke-Morris OPTIONS IN A SELECT LIST   Configures the options in a Select List  Attributes:  value  selected 19

Copyright © Terry Felke-Morris CHECKPOINT 1. You are designing a web site for a client who sells items in a retail store. They want to create a customer list for marketing purposes. Your client sells to consumers and needs a form that accepts their customer’s name and address. Would you recommend using two input boxes (one for the name and one for the ) or three input boxes (for the first name, last name, and address)? Explain your answer. 20

Copyright © Terry Felke-Morris CHECKPOINT 2. You are designing a survey form for a client. One of the questions has 10 possible responses. Only one response can be selected per question. What type of form control would you use to configure this question on the web page? 3. True or False. In a radio button group, the value attribute is used by the browser to process the radio buttons as a group. 21

Copyright © Terry Felke-Morris INPUT IMAGE BUTTON Submits the form When clicked: ◦ Triggers the action method on the form tag ◦ Sends the form data (the name=value pair for each form element) to the web server. Attributes: ◦ type=“image” ◦ name ◦ id ◦ src 22

Copyright © Terry Felke-Morris BUTTON ELEMENT A container tag When clicked, its function depends on the value of the type attribute. Can contain a combination of text, images, and media Attributes: ◦ type=“submit”, type=“reset”, type=“button” ◦ name ◦ id ◦ alt ◦ value 23

Copyright © Terry Felke-Morris ACCESSIBILITY & FORMS  Label Element  Fieldset Element  Legend Element  Tabindex Attribute  Accesskey Attribute 24

Copyright © Terry Felke-Morris LABEL ELEMENT   Associates a text label with a form control  Two Different Formats: Or 25

Copyright © Terry Felke-Morris FIELDSET AND LEGEND ELEMENTS  The Fieldset Element  Container tag  Creates a visual group of form elements on a web page  The Legend Element  Container tag  Creates a text label within the fieldset 26 Customer Information Name:

Copyright © Terry Felke-Morris TABINDEX ATTRIBUTE  Attribute that can be used on form controls and anchor tags  Modifies the default tab order  Assign a numeric value 27

Copyright © Terry Felke-Morris ACCESSKEY ATTRIBUTE  Attribute that can be used on form controls and anchor tags  Create a “hot-key” combination to place the focus on the component  Assign a value of a keyboard letter  On Windows use the CTRL and the “hot-key” to move the cursor 28

Copyright © Terry Felke-Morris CHECKPOINT 1. Describe the purpose of the fieldset and legend elements. 2. Describe the purpose of the accesskey attribute and how it supports accessibility. 3. When designing a form, should you use the standard submit button, an image button, or a button tag? Are these different in the way that they provide for accessibility? Explain your answer. 29

Copyright © Terry Felke-Morris USING CSS TO STYLE A FORM Student Files: formcss.html 30 form { background-color: #eaeaea; font-family: Arial, sans-serif; padding: 10px;} label { float: left; width: 100px; clear: left; text-align: right; padding-right: 10px; margin-top: 10px; } input, textarea { margin-top: 10px; display: block; } #mySubmit { margin-left: 110px; } form { background-color: #eaeaea; font-family: Arial, sans-serif; padding: 10px;} label { float: left; width: 100px; clear: left; text-align: right; padding-right: 10px; margin-top: 10px; } input, textarea { margin-top: 10px; display: block; } #mySubmit { margin-left: 110px; }

Copyright © Terry Felke-Morris SERVER-SIDE PROCESSING Your web browser requests web pages and their related files from a web server. The web server locates the files and sends them to your web browser. The web browser then renders the returned files and displays the requested web pages for you to use. 31

Copyright © Terry Felke-Morris CGI COMMON GATEWAY INTERFACE  A protocol for a web server to pass a web page user's request to an application program and accept information to send to the user. 32

Copyright © Terry Felke-Morris SERVER-SIDE SCRIPTING One of many technologies in which a server-side script is embedded within a Web page document saved with a file extension such as: ◦.php (PHP) ◦.asp (Active Server Pages) ◦.cfm (Adobe ColdFusion) ◦.jsp (Sun JavaServer Pages) ◦.aspx (ASP.Net). Uses direct execution — the script is run either by the web server itself or by an extension module to the web server. 33

Copyright © Terry Felke-Morris STEPS IN UTILIZING SERVER-SIDE PROCESSING 1. Web page invokes server-side processing by a form or hyperlink. 2. Web server executes a server-side script. 3. Server-side script accesses requested database, file, or process. 4. Web server returns web page with requested information or confirmation of action. 34

Copyright © Terry Felke-Morris COMMON USES OF SERVER-SIDE SCRIPTING  Search a database  Place an order at an online store  Send a web page to a friend  Subscribe to a newsletter 35

Copyright © Terry Felke-Morris SENDING INFORMATION TO A SERVER-SIDE SCRIPT 36

Copyright © Terry Felke-Morris SOURCES OF FREE SERVER-SIDE PROCESSING  Many web host providers offer free scripts for their clients. Contact their support area or FAQ to learn more about their services.  Some web sites that offer FREE remotely hosted scripts (in return for displaying an ad).      

Copyright © Terry Felke-Morris SERVER-SIDE SCRIPTING TECHNOLOGIES JavaServer Pages ColdFusion PHP Ruby on Rails Microsoft’s.NET Framework Microsoft Active Server Pages

Copyright © Terry Felke-Morris CHECKPOINT 1. Describe server-side processing. 2. Describe why communication is needed between the developer of a server-side script and the web page designer. 39

Copyright © Terry Felke-Morris HTML5: TEXT BOX Accepts text information in address format Common Attributes: ◦ type=“ ” ◦ name ◦ id ◦ size ◦ maxlength ◦ value ◦ placeholder ◦ required 40

Copyright © Terry Felke-Morris HTML5: URL TEXT BOX Accepts text information in URL format Common Attributes: ◦ type=“url” ◦ name ◦ id ◦ size ◦ maxlength ◦ value ◦ placeholder ◦ required 41

Copyright © Terry Felke-Morris HTML5: TELEPHONE NUMBER TEXT BOX Accepts text information in telephone number format Common Attributes: ◦ type=“tel” ◦ name ◦ id ◦ size ◦ maxlength ◦ value ◦ placeholder ◦ required 42

Copyright © Terry Felke-Morris HTML5: SEARCH TEXT BOX Accepts search terms Common Attributes: ◦ type=“search” ◦ name ◦ id ◦ size ◦ maxlength ◦ value ◦ placeholder ◦ required 43

Copyright © Terry Felke-Morris HTML5: DATALIST CONTROL Favorite Color: 44

Copyright © Terry Felke-Morris HTML5: SLIDER CONTROL Choose a number between 1 and 100: Low High 45

Copyright © Terry Felke-Morris HTML5: SPINNER CONTROL Choose a number between 1 and 10: <input type="number" name="myChoice" id="myChoice" min="1" max="10"> 46

Copyright © Terry Felke-Morris HTML5: CALENDAR CONTROL Choose a Date 47

Copyright © Terry Felke-Morris PRACTICE WITH AN HTML5 FORM  The form display and functioning varies with browser support. 48

Copyright © Terry Felke-Morris SUMMARY  This chapter introduced the use of forms on web pages.  You learned about how to configure form elements and provide for accessibility.  You also learned how to configure a form to access server-side processing.  In addition, you learned about new HTML5 form controls. 49