1 HTML forms (cont.)

Slides:



Advertisements
Similar presentations
HTML Forms. collect information for passing to server- side processes built up from standard widgets –text-input, radio buttons, check boxes, option lists,
Advertisements

Tutorial 6 Creating a Web Form
Creating a Form on a Web Page
Technologies for web publishing Ing. Václav Freylich Lecture 4.
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
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.
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.
USER INTERACTIONS: 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.
Creating Web Page Forms
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
ECA 228 Internet/Intranet Design I Forms. ECA 228 Internet/Intranet Design I Forms forms are a way for a user to communicate with you – text fields –
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
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.
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.
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 7: Web Forms.
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 © 2004 ProsoftTraining, All Rights Reserved. Lesson 7: Web Forms © 2007 Prosoft Learning Corporation All rights reserved ITD 110 Web Page Design.
HTML Concepts and Techniques Fourth Edition Project 7 Creating a Form on a Web Page.
HTML Forms.
1 HTML Forms
Dreamweaver MX. 2 Overview of Templates n Forms enable you to collect data from ______. n A form contains ________ such as text fields, radio buttons,
ITCS373: Internet Technology Lecture 5: More HTML.
XHTML & Forms. PHP and the WWW PHP and HTML forms – Forms are the main way users can interact with your PHP scrip Typical usage of the form tag in 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
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.
1 Review of Form Elements. 2 The tag Used in between tags.  Form elements(text control, buttons, etc.. ) goes here. OR  Form elements(text control,
1 HTML Forms
1 HTML forms (cont.)
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
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 COE 201- Computer Proficiency.
HTML Forms.
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.
Chapter 9 Quick Links Slide 2 Performance Objectives Understanding Forms Planning Forms Creating Forms Creating Text Fields Creating Hidden Fields Creating.
20-753: Fundamentals of Web Programming 1 Lecture 6: Advanced HTML Fundamentals of Web Programming Lecture 6: Advanced HTML.
1 HTML Forms
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.
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.
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
New Perspectives on Creating Web Pages with HTML
Introducing Forms.
CNIT 131 HTML5 - Forms.
Chapter 6: Creating Web Page Forms. An Example of a Form.
HTML Forms
Presentation transcript:

1 HTML forms (cont.)

2 What have we learned so far…  How to create o Form structure o Fieldset to group different forms o Textbox o Password textbox  So, we now know how the regular text entering forms can be created.  What if the choice must be made from a pre-determined set of items?

3 Using a Selection List

4 Creating a selection list  a selection list is a list box from which a user selects a particular value or set of values  good for that a fixed set of possible responses is to be selected  help prevent spelling mistakes and erroneous entries.  Created using tag.  The tag is used to specify each of the selection items.

5 Using & tags  general syntax for and tags is: item1 item2. o name and id attribute identify the selection field o each tag represents an individual item in the selection list o the text in the selection list is indicated by the text in item1, item2, and so forth

6 So you get a Selection List as shown below… size = "1" size = "9"

7 Modifying the appearance of a selection list  By default, the tag displays one option from the selection list, along with a list arrow to view additional selection options  The number of options displayed can be modified with the size attribute.  The syntax of the size attribute is: o value is the number of items that a selection list displays in the form o by specifying a value greater than 1, the selection list changes from a drop-down list box to a list box

8 Selection lists with different size values size = "1" size = "4" size = "7" size = "9" if the size value equals to the number of options in the selection list, scroll bar is either not displayed or is dimmed

9 Making multiple selections  The previous drop-down list allows us to choose only one item at a time…  What if the user needs to choose multiple items from a selection list?  What do we do as the web designers?

10 Making multiple selections  Adding the multiple attribute to the tag allows multiple selections from a list.  The syntax for this attribute is: …  A common method to make multiple selections from a selection list is to hold down a specific key while making selections. o for noncontiguous selections, press and hold the Ctrl key while you make your selections o for a contiguous selection, select the first item, press and hold the Shift key, and then select the last item in the range

11 Additional advantage: Setting default option  Specify which of the options should be selected automatically by default by the designer,  Using selected attribute  Syntax for this attribute is: text

12 Working with option groups  the most recent releases of HTML allows you to organize selection lists into distinct groups called option groups a single option group option group label

13 Option Groups a single option group option group label a single option group option group label

14 Selection lists vs. radio buttons  Use selection list, if o you have a long list of options o you want to allow users to select more than one option (use a selection list with the multiple attribute)  Use radio buttons, if o you have a short list of options, and only one option is allowed at a time

15 Working with check boxes  Check box is another similar control element used for selection purpose…  A check box is either selected or not, there is only one check box per field.  Check boxes are created using the following syntax: o name and id attribute identify the check box o the value attribute specifies the value that is sent to the CGI script when the check box is selected  To select a check box by default

16 Creating a text area  We have seen text box…now we create text area…mostly used for comments from users  to create a text area for a text box, use tag default text o rows and cols attributes define the dimensions of the text box o rows attribute indicates the number of lines in the text box  default text can be specified in the text box when the form is initially displayed.

17 Creating a text area (cont.) resulting text area dimensions of text area default text Comments Enter comments here.

18 Using wrap attribute (cont.)  wrap user ’ s comments to the next line in the text area  value of wrap attribute is soft, hard or off o soft value automatically wraps the text to the next line when it exceeds the width of the box o hard value also wraps text automatically, in the meantime, preserves any line wrapping that takes place in the text box when sending it to CGI o off value sets all the text to be displayed in a single line  default value for wrap attribute is soft

19 Creating form buttons  Form buttons can be clicked to o run programs o submit forms o reset the form to its original state

20 Creating push buttons  syntax for creating a push button o text is the text that appears on the button  push buttons perform no actions by themselves  need a script to associate an action with a push button

21 Creating submit/reset buttons  a submit button is a button that submits the form to a CGI script for processing  a reset button erases users ’ input and resets form to its original (default) values  the syntax for creating these two buttons is: o value attribute defines the text that appears on the button

22 Using name and value attributes  use name and value attributes when a form contains multiple buttons

23 Creating buttons using the tag  tag does not allow the Web page designer to control the appearance of a button  tag enables artistic control over the appearance of form buttons  The syntax of the tag is: button text and HTML tags o name attribute specifies the name of the button o value attribute sends to a CGI script o type attribute specifies the button type (submit, reset, or button)

24 Example the button type is a simple push button contents of the button button image The figure shows how to create a button that contains formatted text and an inline image. The default value for the type attribute is “button”. Within the tags you can place whatever HTML tags you wish to format the button’s appearance. This includes inline images. Go to the Home Page

25 Creating file buttons  a file button is used to select files  contents of the file are not displayed--only the file ’ s location is  syntax for creating a file button here, type attribute’s value is “file”

26 Using a file button, example 1. User clicks the Browse button 2. Selects a file from the Choose File dialog box 3. The filename and location are automatically placed in the text box The figure shows an example of using the file button to return the location of a file named “report.doc.”

27 Working with form attributes  attributes to the tag o specify where to send the form data o specify how to send  syntax o action specifies the filename and location of the CGI script that process the form o method specifies how your Web browser sends data to the CGI script o enctype specifies the format of the data stored in the form ’ s field

28 The method attribute  two possible values for the method attribute o get or post  get method (default value for method attribute) o packages the form data by appending it to the end of the URL specified in the action attribute o some Web servers limit the amount of data sent via get method and will cut off valuable information  post method o sends form data in a separate data stream, allowing the Web server to receive the data through what is called “ standard input ” o is preferred for sending data to a Web server o Web servers do not limit the amount of data sent via post method

29 The enctype attribute  defines the technique used to encrypt form data  default enctype value is “ application/x-www-form- urlencoded. ”  another enctype value that is often used is “ multipart/form-data, ”  The most basic way of encoding data is to use “ text/plain, ” which encodes the data as simple text.

30 Specifying where and how to send form data This following example shows the CGI script that processes the form is located at the URL (a fictional address) and uses the “post” method. LanGear Registration Form <form name=“reg” action=“ method=“post”>