1 HTML Forms

Slides:



Advertisements
Similar presentations
Tutorial 6 Creating a Web Form
Advertisements

Multimedia and the World Wide Web HCI 201 Lecture Notes #5B.
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.
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 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.
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?
Lesson 13: Building Web Forms Introduction to Adobe Dreamweaver CS6 Adobe Certified Associate: Web Communication using Adobe Dreamweaver CS6.
Web111a_chapt06.ppt HTML: Section 6 Forms HTML tags: define data input and/or output Define the Input and/or Output on the web page Do not process the.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
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.
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.
 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.
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
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
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.
Microsoft FrontPage 2003 Illustrated Complete Creating a Form.
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.
Form Components and Elements
1 HTML Forms
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
Project 6 Creating Forms on a Web Page. Objectives Define terms related to forms Describe the different form controls and their uses Use the tag Create.
Creating Web Page Forms COE 201- Computer Proficiency.
HTML Creating Forms on a Web Page. 2 Objectives  Discuss the process of creating a form  Distinguish between data input controls and text input controls.
HTML Forms.
Week 10: HTML Forms HNDIT11062 – Web Development.
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
Lesson 5 Introduction to HTML Forms. Lesson 5 Forms A form is an area that can contain form elements. Form elements are elements that allow the user to.
HTML Structure II (Form) WEEK 2.2. Contents Table Form.
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
ITE 115 Creating Web Page Forms
Designing Forms Lesson 10.
CNIT 131 HTML5 - Forms.
Chapter 6: Creating Web Page Forms. An Example of a Form.
HTML Forms
Presentation transcript:

1 HTML Forms

2 An example of an HTML form

3 Form components and elements This figure shows a form that contains various control elements commonly used in Web page forms. First Name Address #1 Address #2 City Last Name Country StateZip Item PurchasedPurchase Date Home Business Government Educational Institution Netware Banyan Vines Windows IBM Lan Server Comments?: Send Registration Cancel Serial Number Used For (check one) Network Operating System (check all that apply) Religious or Charitable Institution PC/NFS text box drop-down list box radio buttons check boxes text area form button group box

4 Form control elements  Control elements that are commonly used: o text boxes for text and numerical entries o selection lists for long lists of options, usually appearing in a drop-down list box o radio buttons, also called option buttons, to select a single option from a predefined list o check boxes to specify an item as either present or absent, can have multiple choices o groups boxes to organize form elements o text areas for extended entries that can include several lines of text o buttons that can be clicked to start processing the form

5 Form control elements (cont.)  Each control element in which the user can enter information is called a field  Information entered into a field is called the field value, or simply the value  In some fields, users are free to enter anything they choose  Other fields, such as selection lists, limit the user to a predefined list of options

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. 6

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: o ASP o ColdFusion o C/C++ o PHP o VBScript 7

8 The tag  The tag identifies the beginning and end of a form  A single page can include several different forms, but you cannot nest one form inside another  The general syntax of the tag is: form elements and layout tags  Between the and tags, place the various tags for each of the fields in the form

9 The tag (cont.)  A single Web page can contain multiple forms, the tag includes the name or id attribute.  name/id attribute identifies each form on the page.  name/id attribute is also needed for programs that retrieve values from the form.

10 Creating a field set  A fieldset groups similar fields together  When rendered by browser, a field set appears as a box surrounding the fields  Example contact information  the tag is used to display a legend for a field set  legend text specifies the text for that legend

11 The tag  tag specifies particular input types for a form  syntax

12 Input types This figure shows other supported HTML input types.

13 Working with form fields  The general syntax is: o type specifies the type of input field o name and id attributes identifies the input field for the CGI script  To create a text box, you would enter the tag:  If the type attribute is not included, the Web browser assumes, by default, that you want to create a text box.

14 Creating a text box  To create a text box, use the following HTML code: o name and id attributes identify the field o value attribute assigns a default value to the text box o size attribute defines the width of the text box in number of characters o maxlength attribute defines the maximum number of characters allowed in the field

15 Controlling the size of a text box  By default, all text boxes are 20 characters wide.  The syntax for changing the size of a text box is: o value is the size of the text box in characters o Exmaple

16 Setting the maximum length for text input  Setting the width of a text box does not limit the number of characters the box can hold. o if a user enters text longer than the box ’ s width, the text scrolls to the left o the user cannot see the entire text, but all of it is sent to the CGI script for processing  The syntax for setting the maximum length for field input is: o value is the maximum number of characters that can be stored in the field

17 Setting a default value for a field  When the same value is entered into a field, it may make sense to define a default value for a field.  Default values can save time and increase accuracy for users of a Web site.  To define a default value, use the following syntax: o value is the default text or number that is displayed in the field

18 Working with form labels  HTML allows a label to be linked with an associated text element – using for attribute  The syntax for creating a form label is: label text o id is the value of the id attribute for a field on the form o label text is the text of the label o A form label has to be bound with the id attribute, NOT the name attribute of a field

19 Example First Name Last Name

20 Working with radio buttons  Radio buttons display a list of choices from which a user makes a selection.  Only one radio button can be selected at a time.  The syntax to create a radio button is: o name identifies the field containing the radio button o id attribute identifies the specific option. Only required if you intend to use a field label with the radio button o value attribute indicates the value sent to the CGI script, if that radio button is selected by the user

21 Working with radio buttons (cont.)  The name attribute must be included, because it groups distinct radio buttons together. o selecting one radio button in the group automatically deselects all of the other radio buttons in that group  Insert descriptive text next to the button.  Enclose text within a label tag to allow the user to select the radio button or label.

22 Creating a password field  A password field is a text box in which the characters typed by the user are displayed as bullets or asterisks i.e. ****.  The syntax for creating a Password field is:  Using a password field is NOT equivalent to having a secure connection.  The password itself is NOT encrypted.  The password field only acts as a mask for a field entry as it is entered.