Forms provide interaction between the creator of a web site
and people visiting the web site. They can be used for guestbooks,
surveys, and more. To really make a form work, you'll
need to know a programming language, like PERL (Practical Extraction
and Report Language). Some things can be done with JavaScript.
Or, you can modify a free script that will take the contents of a form and send it to a
specified email address. We'll talk about some of these options later
on in this course.
For now, you'll learn to create beautiful, completely non-functioning forms!
INDEX CARD #20:
INTRODUCTION TO FORMS (20a)
What is a form? A form is a formatted document containing blank fields that users can fill in with data. (Think: job application forms;
applications for credit; college application forms; etc.) On the
web, you get an "electronic form" instead of an old-fashioned "paper-and-pencil" form, like this (non-functioning) form:
HTML tags merely describe how the form should look, and where the collected information should be sent. The processing of the information
is done somewhere else.
What happens to the information that gets put into the form? Usually, it's processed by a CGI (Common Gateway Interface) program.
What is a "CGI program"? A CGI program is any program designed to accept and return data that conforms to the CGI specification. On Unix, the most common CGI
programming language is PERL; other languages used are C/C++, Java, Visual Basic, and AppleScript.
OTHER WAYS TO INTERACT (20b)
Processing forms using CGI programs (also called "CGI scripts") involves the web server: it's a "server-side" solution to achieving
interactivity. There are also "client-side" solutions that are executed
by your browser: one such client-side solution is JavaScript.
What is JavaScript?JavaScript is a language developed by Netscape used to design interactive sites. It shares many of the features and structures of the full Java language, but was developed independently. (So: Java and
JavaScript are different!) HTML editors often offer lots of
JavaScripts that you can tailor to your needs. Here's a sample of what you can do with JavaScript:
(W20.1) Please continue with the online tutorial located at:
http://www.cwru.edu/help/interHTML/toc.html (link is no longer valid)
Read Chapter 4 (FORMS THEORY) and do the exercises at the end
of Chapter 4.
ASSIGNMENT #20:
(A20.1) In the Weasel Book, please do the following: read page 226 (opening paragraph); quickly skim the "Summary of Form Tags" on pages 226233 to
get a taste of what's involved in forms; then read pages
233234 (on "Introduction to Forms").
(A20.2) See if your HTML editor has some JavaScripts for you to use.
Experiment!
(A20.3) If you haven't already checked out Dynamic Drive to see what JavaScript can
do for you, do it now!