jschap06 - Chapter 6: Forms JavaScript - Introductory...

Info iconThis preview shows pages 1–21. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 6: Forms JavaScript - Introductory
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Previewing the Product Registration Form
Background image of page 2
Tutorial6_ProductInfo.html
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Section A: Working with Forms in JavaScript
Background image of page 4
Objectives In this section students will learn: How to use HTML forms About the Common Gateway Interface How to use the <FORM> tag About form elements How to create and use input fields How to create selection lists How to create multiline text fields
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Overview of Forms Forms are one of the most common HTML elements used with JavaScript Typical forms that you may encounter are order forms, surveys, applications, and a form that gathers search criteria from a user To process the data submitted from a Web browser to a server, use a special protocol named Common Gateway Interface (CGI) CGI is one of the oldest and most popular methods
Background image of page 6
Custom Navigation Buttons Created With a Form
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The Common Gateway Interface Common Gateway Interface (CGI) is a simple protocol that allows Web pages to communicate with Web-server-based programs A CGI’s function is to start a Web-server- based program, then pass and receive environment variables to and from it An environment variable is part of an operating system, not just part of a function or a program
Background image of page 8
The Common Gateway Interface A Web-server-based application that processes CGI environment variables is called a CGI script or CGI program and can be designed to perform a multitude of functions Do not confuse CGI protocol itself with a CGI script CGI protocol’s primary purpose is to send that data received from a Web page to a program on a server, then send any response back to the Web page CGI scripts are often placed within a bin (for binary) or cgi-bin directory on a Web server
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CGI Script Written in PERL
Background image of page 10
HTML Document With Two Forms
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The <FORM> Tag All forms begin and end with the <FORM>…</ FORM> tag pair The <FORM>…</FORM> tag pair designates a form within an HTML document and contains all text and tags that make up a form You can include as many forms as you like within an HTML document You cannot nest one form inside another
Background image of page 12
Output of HTML Document With Two Forms
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Attributes of the <FORM> Tag
Background image of page 14
The <FORM> Tag The ENCTYPE attribute specifies an encoding protocol known as Multipurpose Internet Mail Extension, or MIME Encoding with MIME ensures that data is not corrupted when transmitted across the Internet MIME has become a standard method of exchanging files over the Internet An ACTION attribute sends the form’s data to the URL
Background image of page 15

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Three Frames Document
Background image of page 16
Subscription Frame
Background image of page 17

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Emily the Chimp Web Page
Background image of page 18
The <FORM> Tag The METHOD attribute of the <FORM> tag specifies that the form’s data will be sent with the POST method instead of the default GET method The TARGET attribute specifies the window in which text and HTML tags returned from the server are to be rendered After data is received by a server, the imaginary process_subscription CGI script adds the e-mail address to a database, then returns a message to the dialog frame, as shown in Figure 6-11
Background image of page 19

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
After Form Submission
Background image of page 20
Image of page 21
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 80

jschap06 - Chapter 6: Forms JavaScript - Introductory...

This preview shows document pages 1 - 21. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online