Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creating Forms on a Web Page. 2 Introduction  Forms allow Web developers to collect visitor feedback  Forms create an environment that invites people.

Similar presentations


Presentation on theme: "Creating Forms on a Web Page. 2 Introduction  Forms allow Web developers to collect visitor feedback  Forms create an environment that invites people."— Presentation transcript:

1 Creating Forms on a Web Page

2 2 Introduction  Forms allow Web developers to collect visitor feedback  Forms create an environment that invites people to return to the site

3 3 Introduction Web page without a form Web page with a form

4 4 Creating Web Page Forms  Forms interact with Web page visitors in a variety of ways: –Get feedback about the Web page –Find out who is visiting the Web page –Sell products or services –Act as a guestbook

5 5 Creating Web Page Forms  A Web page form has three components –Input controls –FORM tag, which contains the information necessary to process the form –Submit button, which sends the data to be processed

6 6 Input Controls  An input control is a type of input mechanism on a form  A data input control allows a user to simply make a selection  A text input control allows the user to enter text into the control

7 7 Input Controls

8 8 Text Control  Allows for a single line of input  Two attributes –SIZE: determines the number of characters that display on the form –MAXLENGTH: specifies the maximum length of the input field

9 9 Password Control  Same as a regular text field, but characters display as asterisks or bullets  Holds the password entered by a visitor  Protects a visitor’s password from being observed by others

10 10 Textarea Control  Allows multiple lines of input  Two primary attributes –ROWS: specifies the number of rows in the textarea field –COLS: specifies the number of columns in the textarea field

11 11 Select Control  Creates a selection menu from which visitors can select one or more choices  Visitors don’t have to type in any information

12 12 Checkbox Control  Allows users to select more than once choice from a list of choices  Each choice in a checkbox list can be either on or off –Checkboxes are deselected by default

13 13 Radio Control  Limits the Web page visitor to only one choice from a list of choices  Each choice is preceded by a radio button, typically an open circle –Radio buttons are deselected by default

14 14 Reset and Submit Controls  The Reset button clears any input that was entered in the form  The Submit button sends the information to the appropriate location for processing –Web page forms must include a Submit button

15 15 Input Controls  Each input control has the following one or two attributes –NAME: Identifies the specific information that is being sent  All controls have a NAME –VALUE: The data that is contained in the named input control  All controls except TEXTAREA have a VALUE attribute

16 16 Form Tags  Input controls are tags or attributes of tags:

17 17

18 18 Identifying the Form Process  attributes –METHOD: Specifies the manner in which the form is sent to the server  The GET method sends the name-value pairs to the end of the URL indicated in the ACTION attribute  The POST method sends a separate data file to the URL –Class projects will utilize the POST method

19 19 Identifying the Form Process  attributes –ACTION: specifies the action that will be taken when the form is submitted  Information can be sent by e-mail to a central e-mail address  Information can be sent to the Web server for processing  Web sites can process information from forms using Common Gateway Interface (CGI) scripting

20 20 Identifying the Form Process determines how data is sent action to be taken when submitted

21 21 Adding Radio Buttons field namecontrol type value of field if “Yes” is selected Field name – must be the same for radio buttons value of field if “No” is selected

22 22 Adding a Text Field control type field name Number of characters that display on Web page maximum number of characters that can be input

23 23 Adding Textareas start textareafield name number of rows number of columns end textarea

24 24 Submit and Reset Buttons control type text to display on Submit button control type text to display on Reset button

25 25 Test on Friday – February 6th! Questions??? If you need a book, come and get one!


Download ppt "Creating Forms on a Web Page. 2 Introduction  Forms allow Web developers to collect visitor feedback  Forms create an environment that invites people."

Similar presentations


Ads by Google