1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.

Slides:



Advertisements
Similar presentations
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Advertisements

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
COS 125 DAY 26. Agenda Assignment #7 Graded  10 A’s, 4 B’s, and 1 non-submit Assignment # 8 Due April 27 Assignment #9 will be assigned in WebCT by Tuesday.
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.
Creating Web Page Forms
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
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.
CST JavaScript Validating Form Data with JavaScript.
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.
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.
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 5 Java Script And Forms JavaScript, Third Edition.
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.
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.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
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.
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.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
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.
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.
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.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
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.
COS 125 DAY 17. Agenda  Assignment 7 not finished grading  Assignment 8 posted Due April 9  Capstone progress reports due  Quiz 2 Corrected 2 A’s,
Creating Forms on a Web Page. 2 Introduction  Forms allow Web developers to collect visitor feedback  Forms create an environment that invites people.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Project 6: Creating XHTML Forms Kelly.
expanded by J. Goetz, © Pearson Education Copyright (c) 2006 Prentice-Hall. All rights reserved.
HTML III (Forms) Robin Burke ECT 270. Outline Where we are in this class Web applications HTML Forms Break Forms lab.
FORMS Explained By: Jasdeep Kaur. Lecturer, Department of Computer Application, PGG.C.G., Sector: 42, Chandigarh.
Ashima Wadhwa Java Script And Forms. Introduction Forms: –One of the most common Web page elements used with JavaScript –Typical forms you may encounter.
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:

1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts

© 2007 Pearson Education 2 Learning Outcomes In this chapter, you will learn how to: –Describe common uses of forms on web pages –Describe the elements used in forms –Create forms on web pages using the,,, and tags –Create forms that provide additional accessibility features using the accesskey and tabindex attributes –Associate form elements and element groups using the,, and tags –Create custom image buttons and use the tag to include more variety and richer content than the standard form button –Describe the features of CGI –Invoke server-side processing to handle form data –Find free CGI resources on the Web

© 2007 Pearson Education 3 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. Etc…. A form is an XHTML element that is used to contain and organize other objects such as text boxes, check boxes, and buttons that can accept information from web site visitors.

© 2007 Pearson Education 4 Two Components of Using Forms 1. The XHTML form itself, which is the web page user interface and 2.The server-side processing, called CGI for Common Gateway Interface, which 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.

© 2007 Pearson Education 5 XHTML Using Forms tag –Used to contain the form elements on a web page –Container tag tag –Used to configure a number of form elements including text boxes, radio buttons, check boxes, and buttons –Stand alone tag tag –Used to configure a scrolling text box –Container tag tag –Used to configure a select box (drop down list) –Container tag tag –Used to configure an option in the select box –Container tag

© 2007 Pearson Education 6 Sample Form XHTML

© 2007 Pearson Education 7 XHTML tag The form tag attributes: –action Specifies the server-side program or script will process your form data –id Identifies the form –method get – default value, form data passed in URL post – more secure, form data passed in HTTP Entity Body –name Identifies the form

© 2007 Pearson Education 8 XHTML tag Text box Used to accept text information Attributes: –type=“text” –name –size –maxlength –value

© 2007 Pearson Education 9 XHTML tag Password box Used to accept text information that needs to be hidden as it is entered Attributes: –type=“password” –name –size –maxlength –value

© 2007 Pearson Education 10 XHTML tag Check box Used to allow the user to select one or more of a group of predetermined items Attributes: –type=“checkbox” –name –checked –value

© 2007 Pearson Education 11 XHTML tag Radio Button Used to allow 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 –checked –value

© 2007 Pearson Education 12 XHTML tag Scrolling Text Box Used to configure a scrolling text box Attributes: –name –cols –rows –value

© 2007 Pearson Education 13 XHTML tag Select List Used (along with tags) to configure a Select List. This form element is often referred to by several different names: Select List, Select Box, Drop-Down List, Drop-Down Box, and Option Box. Used to allow the user to select one or more items from a list of predetermined choices. Attributes: –name –size –multiple

© 2007 Pearson Education 14 XHTML tag Options in a Select List Used to configure the options in a Select List Attributes: –value –selected

© 2007 Pearson Education 15 XHTML tag Submit Button Used to submit the form When clicked, it triggers the action method on the tag and causes the browser to send the form data (the name and value pairs for each form element) to the web server. Attributes: –type=“submit” –name –value

© 2007 Pearson Education 16 XHTML tag Reset Button Used to reset the form fields to their initial values Attributes: –type=“reset” –name –value

© 2007 Pearson Education 17 XHTML tag Button Used to offer a flexible user interface There is no default action when the button is clicked Usually a JavaScript function is invoked when a button is clicked Attributes: –type=“button” –name –value

© 2007 Pearson Education 18 XHTML tag Hidden form element This form element is not displayed on the web page. Hidden form fields can be accessed by both client-side and server-side scripting and are sometimes used to contain information needed as the visitor moves from page to page. Attributes: –type=“hidden” –name –value

© 2007 Pearson Education 19 Name: XHTML Using a Table to Format a Form

© 2007 Pearson Education 20 Checkpoint You are designing a web site for a client who sells items in a retail store. They want to create a customer list for e- mail 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.

© 2007 Pearson Education 21 Checkpoint 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 element 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 separate elements as a group.

© 2007 Pearson Education 22 XHTML Form Enhancements tag The label tag Or Container tag Used to associate a text message with a form element

© 2007 Pearson Education 23 XHTML Form Enhancements & tags The fieldset tag –Container tag –Used to create a visual group of form elements on a web page The legend tag –Container tag –Used to create a text label within the fieldset Customer Information Name:

© 2007 Pearson Education 24 XHTML Form Enhancements tabindex attribute Attribute that can be used on form elements and anchor tags Not supported by all browsers Used to modify the default tab order Assign a numeric value

© 2007 Pearson Education 25 XHTML Form Enhancements accesskey attribute Attribute that can be used on form elements and anchor tags Not supported by all browsers Used to 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

© 2007 Pearson Education 26 XHTML Form Enhancements tag Image Button Used to submit the form When clicked, it triggers the action method on the tag and causes the browser to send the form data (the name and value pairs for each form element) to the web server. Attributes: –type=“image” –name –src

© 2007 Pearson Education 27 XHTML Form Enhancements tag The button tag 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 –value

© 2007 Pearson Education 28 Checkpoint Describe the purpose of the fieldset and legend tags. 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.

© 2007 Pearson Education 29 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.

© 2007 Pearson Education 30 CGI Common Gateway Interface CGI is a protocol or standard method for a web server to pass a web page user's request (which is typically initiated through the use of a form) to an application program and accept information to send to the user. The web server typically passes the form information to a small application program that processes the data and usually sends back a confirmation web page or message.

© 2007 Pearson Education 31 Using CGI A web page invokes CGI by either an action method on a form or a hyperlink -- the URL of the server-side script or program is used. Any form data that exists is passed to the server-side CGI script. The server-side script completes its processing and may create a confirmation or response Web page with the requested information. The web server returns this page to the web browser.

© 2007 Pearson Education 32 Languages that support CGI Programs or scripts that work with CGI can be written in many languages: PHP Perl C C++ Active Server Pages (ASP) Java Server Pages (JSP) ASP.NET Ruby on Rails And so on….

© 2007 Pearson Education 33 Steps in Utilizing CGI 1.Web page invokes CGI by a form post, action, hyperlink, etc... – Any form information is sent in the form of name=value pairs to the web sever. 2. Script on web server is executed 3. Script accesses requested database, file, or process 4. Web server returns web page with requested information or confirmation of action

© 2007 Pearson Education 34 Common Uses of Server-Side Scripting & CGI Search a database Place an order at an online store Send a web page to a friend Subscribe to a newsletter Any type of server-side file or processing is a candidate for CGI

© 2007 Pearson Education 35 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 remotely hosted scripts (in return for displaying an ad). – – – – – Microsoft FrontPage has Server Extensions that provide form processing: sending form data in s, saving form data in files, and saving form data in databases.

© 2007 Pearson Education 36 Checkpoint Describe CGI. 2.Code the form tag for a web page form that will use the post method to invoke a server-side script located at

© 2007 Pearson Education 37 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