Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 12 Working with Forms Principles of Web Design, 4 th Edition.

Similar presentations


Presentation on theme: "Chapter 12 Working with Forms Principles of Web Design, 4 th Edition."— Presentation transcript:

1 Chapter 12 Working with Forms Principles of Web Design, 4 th Edition

2 12-2 Objectives Understand how forms work Understand form syntax Create input objects Build forms within tables Build and test a sample form

3 Principles of Web Design, 4th Edition12-3 Understanding How Forms Work

4 Principles of Web Design, 4th Edition12-4 Understanding How Forms Work Forms let you build interactive Web pages that collect information from a user and process it on the Web server The HTML form is the interface for the user to enter data The data is processed by applications that reside on the Web server

5 Principles of Web Design, 4th Edition12-5

6 Principles of Web Design, 4th Edition12-6 Using CGI Scripts The Common Gateway Interface (CGI) is the communications “bridge” between the Internet and the server Using programs called scripts, CGI can collect data sent by a user via the Hypertext Transfer Protocol (HTTP) and transfer it to a variety of data processing programs including spreadsheets, databases, or other software running on the server

7 Principles of Web Design, 4th Edition12-7

8 Principles of Web Design, 4th Edition12-8 Using CGI Scripts (continued) The data processing software can then work with the data and send a response back to CGI, and then onto the user The user enters data via an HTML form

9 Principles of Web Design, 4th Edition12-9 Understanding Form Syntax

10 Principles of Web Design, 4th Edition12-10 Forms Syntax Five basic form elements are commonly supported by the major browsers: –

11 Principles of Web Design, 4th Edition12-11 Forms Syntax (continued) HTML 4.01 introduced five new form elements: –

12 Principles of Web Design, 4th Edition12-12 Using the element The element is the container for creating a form A variety of attributes describe how the form data will be handled

13 Principles of Web Design, 4th Edition12-13

14 Principles of Web Design, 4th Edition12-14 Using the element (continued) The following code shows a typical element:

15 Principles of Web Design, 4th Edition12-15 Creating Input Objects

16 Principles of Web Design, 4th Edition12-16 Creating Input Objects The element defines many of the form input object types The type attribute specifies the type of input object

17 Principles of Web Design, 4th Edition12-17

18 Principles of Web Design, 4th Edition12-18 Creating Text Boxes The text box is the most commonly used form element

19 Principles of Web Design, 4th Edition12-19

20 Principles of Web Design, 4th Edition12-20 Creating Check Boxes Check boxes are an on/off toggle that the user can select Smallmouth Bass

21 Principles of Web Design, 4th Edition12-21

22 Principles of Web Design, 4th Edition12-22 Creating Radio Buttons Radio buttons are like check boxes, but only one selection is allowed Yes

23 Principles of Web Design, 4th Edition12-23

24 Principles of Web Design, 4th Edition12-24 Creating Submit & Reset Buttons The submit and reset buttons let the user choose whether to send the form data or start over

25 Principles of Web Design, 4th Edition12-25

26 Principles of Web Design, 4th Edition12-26 Creating a Custom Event Button Custom event buttons activate a function in some associated program or script Click the calculate button to total your order:

27 Principles of Web Design, 4th Edition12-27

28 Principles of Web Design, 4th Edition12-28 Creating an Image for the Submit Button You can choose an image file and use it instead of the default submit button

29 Principles of Web Design, 4th Edition12-29

30 Principles of Web Design, 4th Edition12-30 Letting the User Submit a File Users can select a file on their own computer and send it to the server Use the browse button to select your file:

31 Principles of Web Design, 4th Edition12-31

32 Principles of Web Design, 4th Edition12-32 Creating a Password Entry Field The password input box works like the text input, but the entered text is hidden by asterisks password:

33 Principles of Web Design, 4th Edition12-33

34 Principles of Web Design, 4th Edition12-34 Using the Element The element lets you create a list box or scrollable list of selectable options Canoe Jon Boat Kayak Bass Boat Family Boat

35 Principles of Web Design, 4th Edition12-35

36 Principles of Web Design, 4th Edition12-36 Using the Element (continued) You can choose to let the user pick multiple values from the list by adding the multiple attribute Potato Chips Popcorn Peanuts Pretzels Nachos Pizza Fries

37 Principles of Web Design, 4th Edition12-37

38 Principles of Web Design, 4th Edition12-38 Using the Element (continued) You group and label sets of list options with the element and label attribute Potato Chips Popcorn Peanuts Pretzels

39 Principles of Web Design, 4th Edition12-39

40 Principles of Web Design, 4th Edition12-40 Using the Element The element lets you create a larger text area for user input Briefly tell us your favorite fish story: Enter your story here...

41 Principles of Web Design, 4th Edition12-41

42 Principles of Web Design, 4th Edition12-42 Creating Input Groupings You can use the and elements to create groupings of different types of input elements

43 Principles of Web Design, 4th Edition12-43 Creating Input Groupings (continued) Select the species you prefer to fish: Smallmouth Bass Largemouth Bass Pike

44 Principles of Web Design, 4th Edition12-44

45 Principles of Web Design, 4th Edition12-45 Building Forms within Tables

46 Principles of Web Design, 4th Edition12-46 Building Forms within Tables Placing forms within a table can enhance the layout and legibility of the form

47 Principles of Web Design, 4th Edition12-47

48 Principles of Web Design, 4th Edition12-48

49 Principles of Web Design, 4th Edition12-49 Summary You will need to work with some type of server-based software program to process the data from your form You have a variety of form elements to choose from when building a form –Use the correct type of form element for the type of data you are gathering –For example, use check boxes for multiple-choice questions; for a long list of choices, use a select list

50 Principles of Web Design, 4th Edition12-50 Summary (continued) The and elements let you create more visually appealing forms that have logical groupings of input elements with a title You can control the ragged look of forms by placing them within tables to control the alignment of input elements


Download ppt "Chapter 12 Working with Forms Principles of Web Design, 4 th Edition."

Similar presentations


Ads by Google