XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.

Slides:



Advertisements
Similar presentations
Tutorial 6 Creating a Web Form
Advertisements

Supplement Creating Forms. Objectives Show how forms are used How to create the Form element HTML elements used for creating input fields.
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
XP Tutorial 6: Creating Web Page Forms. XP An Example of a Form.
XP 1 New Perspectives on Creating Web Pages with HTML Tutorial 6: Creating Web Page Forms.
XP Creating Web Pages with HTML, 3e Prepared by: C. Hueckstaedt, Tutorial 6 1 New Perspectives on Creating Web Pages with HTML Tutorial 6: Creating Web.
Gathering Requirements What do users want?. Information Gathering Techniques Surveys Interviews Focus Groups.
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.
Creating Web Page Forms
Tutorial 6: Creating a Web form
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
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.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
XP Tutorial 6New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Creating Web Page Forms Designing a Product Registration Form Tutorial.
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.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
การจัดรูปแบบเว็บด้วย CSS การเขียนโปรแกรมเว็บ. Selectors & cascading PatternMeaning *Universal selector: matches any element. EType selector: matches any.
HTML II. Factors to consider in designing a website. Organizing your files. HTML Tables. Unordered Lists. Ordered Lists. HTML Forms. Learning Objectives.
XP 1 New Perspectives on Creating Web Pages with HTML Tutorial 6: Creating Web Page Forms.
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
Working with Forms. How Forms Work Forms let you build interactive Web pages that collect information from a user and process it on the Web server The.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
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.
Website Development with PHP and MySQL Saving Data.
HTML Forms.
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
1 HTML Forms
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
ITCS373: Internet Technology Lecture 5: More HTML.
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
1 HTML Forms
XP 1 Tutorial 6 Creating Web Page Forms. XP 2 Tutorial Objectives  Describe how Web forms can interact with a server-based program  Review the various.
Starting BBEdit or Notepad and Opening the HTML File Start BBEdit or Notepad Select Open from the File Menu Open survey1.htm from the Public Folder.
1 HTML forms (cont.)
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
Form Processing Week Four. Form Processing Concepts The principal tool used to process Web forms stored on UNIX servers is a CGI (Common Gateway Interface)
Creating Web Page Forms COE 201- Computer Proficiency.
Basic Webpage Design HTML Forms. Objectives Learn how to use HTML to create a form. Explain the concept of forms Know the difference of GET and POST Discuss.
HTML Forms. A form is simply an area that can contain form fields. Form fields are objects that allow the visitor to enter information - for example text.
1 HTML Forms
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.
1 HTML forms (cont.)
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Tutorial 6 Creating a Web Form
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
ITE 115 Creating Web Page Forms
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
Today - Forms! WD Students produce a basic HTML/XHTML document using forms. Find the group that best matches the part of the project you are going.
New Perspectives on Creating Web Pages with HTML
Designing Forms Lesson 10.
CNIT 131 HTML5 - Forms.
Chapter 6: Creating Web Page Forms. An Example of a Form.
HTML Forms
Presentation transcript:

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 2 Objectives Describe how Web forms can interact with a server-based program Insert a form into a Web page Create and format an input box for simple text data Add a form label and link it to a control element

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 3 Objectives Set up a selection list for a predefined list of data values Create option buttons for a list of possible field values Organize fields into field sets Insert a text area box for multiple lines of text data

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 4 Objectives Generate form buttons to submit or reset a form Describe how data is sent from a Web form to a server Understand how to create image fields, hidden fields, and file buttons Apply tab indices and access keys to control elements

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 5 Introducing Web Forms Web forms collect information from customers. Web forms include different control elements including: –Input boxes –Selection lists –Drop-down lists boxes –Option buttons or radio buttons –Check boxes –Group boxes –Text areas –Form buttons

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 6 Forms and Server-Based Programs While HTML supports the creation of forms, it does not include tools to process the information. The information can be processed through a program running on a Web server.

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 7 Forms and Server-Based Programs Server-based programs are written in many languages The earliest and most commonly used are Common Gateway Interface (CGI) scripts that are written in perl. Other popular languages include: –AppleScript- PHP –ASP- TCL –ColdFusion- the Unix shell –C/C++- Visual Basic

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 8 Creating the Form Element Forms are created using the form element, structured as follows: elements Where attributes are the attributes that control how the form is processed and elements are elements places within the form.

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 9 Creating the Form Element Form attributes usually tell the browser the location of the server-based program to be applied to the form’s data. Always specify an id or name for the form. Two attributes are available to identify the form: id and name.

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 10 Creating the Form Element The syntax of the id and name attributes are as follows: … Where name is the name of the form and id is the id of the form.

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 11 Creating Input Boxes The general syntax of input elements is as follows: Where type specifies the type of input field, and the name and id attributes provide the field’s name and id. See figure 6-5 for other input types.

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 12 Setting the Size of an Input Box By default, an input box displays at 20 characters of text. To change the width of an input box, use the size attribute which is displayed as follows: Where value is the size of the input box in characters.

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 13 Setting the Size of an Input Box

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 14 Creating a Password Field A password field is an input box where characters typed by the user are displayed as bullets or asterisks to protect private or sensitive information on a Web site. The syntax for creating a Password field is as follows:

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 15 Working with Form Labels You can also expressly link a label with an associated text element for scripting purposes. The syntax for creating a form label is as follows: label text Where id is the value of the id attribute for a field on the form, and label text is the text of the label.

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 16 Creating a Selection List A selection list is a list box from which a user selects a particular value or set of values. –Selection lists are useful when there are a fixed set of possible responses from the user. You can create a selection list using the tag. You can specify each individual selection item using the tag.

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 17 Modifying the Appearance of a Selection List You can change the number of options displayed in the selection list by modifying the size attribute. The syntax is as follows: … Where value is the number of items that the selection list displays in the form.

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 18 Modifying the Appearance of a Selection List

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 19 Making Multiple Selections Add the multiple attribute to the select element to create multiple selections …

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 20 Working with Option Groups Use option groups to organize selection lists into distinct groups. itema1 itema2 … itema1 itema2 … …

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 21 Creating Option buttons Option buttons, or radio buttons allow users to make selections. –Unlike selection lists, option buttons only allow the user to select one option at a time. All option buttons belonging to the same field share a common name Labels are matched to the id values of the option buttons

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 22 Creating a Field Set HTML and XHML allow you to organize option buttons into a group of fields called field sets. –Most browsers place a group box around a field set to indicate that the fields belong to a common group. fields Where fields are the individual fields within a set.

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 23 Creating Check Boxes To create a check box, use: Where the name and id attributes identify the check box field and the value attribute specifies the value sent to the server if the check box is selected. To specify that a check box be selected by default, use the checked attribute as follows: or

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 24 Creating a Text Area Box Text area boxes allow users to enter comments about the products they’ve purchased. An input box would be too small to accommodate the length of text for this use.

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 25 Creating a Text Area Box To create a text area box, use the textarea element: default text Where the rows and cols attributes define the dimensions of the input box and the rows attribute indicates the number of lines in the input box.

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 26 Creating a Text Area Box

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 27 Working with Form Buttons Buttons are a type of control element that performs an action. Types of buttons: –Command button –Submit button –Reset button –File button

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 28 Creating a Command button Command buttons are created using the tag: Submit buttons submit forms to the server for processing when clicked. Syntax is as follows: Reset buttons reset forms to their original (default) values. Syntax is as follows:

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 29 Completed Registration Form

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 30 Creating a File button File buttons are used to select files so that their contents can be submitted for processing to a program. The Web page then only displays the file’s location, not the file’s contents.

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 31 Working with Hidden Fields Hidden fields are added to a form, but not displayed in the Web page. The syntax is as follows: <input type=“hidden” name=“name” id=“id” value=“value” />

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 32 Working with Form Attributes After adding the elements to your form, you’ll need to specify where to send the form data and how to send it. Use the following attributes: … Where url specifies the filename and location of the program that processes the form and the method attribute specifies how your Web browser sends data to the server. The enctype attribute specifies the format of the data stored in the form’s field.

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 33 Working with Form Attributes The method attribute can have one of two values: –Post –Get The get method is the default; get appends the form data to the end of the URL specified in the action attribute. The post method sends form data in a separate data stream, allowing the Web server to receive the data through “standard input”.

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 34 Using the mailto Action The mailto action accesses the user’s own program and uses it to mail form information to a specified address. –By-passes the need for server-based programs. The syntax is as follows: <form action-mailto: _address method=“post”mailto: _address enctype=“text/plain”> … Where _address is the address of the recipient in the form.

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 35 Specifying the Tab Order Users typically navigate through a form with the tab key. You can specify an alternate tab order by adding the tabindex attribute to any control element in your form. The syntax is as follows: This syntax assigns the tab index number “1” to the fname field from the registration form.

XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 36 Specifying an Access Key An access key is a single key typed with the Alt key (Windows) or Control key (Mac), in order to jump to one of the control elements in the form. Create an access key by adding the accesskey attribute to any control element. Example of creating an access key for the lname field: