Project Four Forms •Discuss form processing •Describe the difference between client-side and server- side form processing •Add a horizontal rule to a Web page •Create a form •Discuss form design •Insert a table into a form •Describe form objects •Describe and add text fields and text areas to a form •Describe and add check boxes and radio buttons to a form •Describe and add lists and menus to a form •Describe and add form buttons to a form •Describe form accessibility options •Apply behaviors to a form •View and test a form
38
Embed
Project Four Forms Discuss form processing Describe the difference between client-side and server-side form processing Add a horizontal rule to a Web page.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Project FourForms
•Discuss form processing•Describe the difference between client-side and server-side form processing•Add a horizontal rule to a Web page•Create a form•Discuss form design•Insert a table into a form•Describe form objects•Describe and add text fields and text areas to a form•Describe and add check boxes and radio buttons to a form•Describe and add lists and menus to a form•Describe and add form buttons to a form•Describe form accessibility options•Apply behaviors to a form•View and test a form
Test ResultsA – 2B – 1C – 2D – 0F – 0
Not Taken – 0
Two versions – Server Side and Client SideRequires 2 separate pages…
Only the Client Side Version of this page
Overview• We will create 4 new pages containing
forms, tables, and form objects.
• Learn the use of text fields, radio buttons, checkboxes, list and pop-up menus, jump menus, submit and reset buttons.
• Learn how to use Behaviors to validate a form.
• Live through a painful set of examples on the use of client side forms and server side forms. :-)
What is a Form?
• Forms provide a way for a user to interact with a web site.
• Provide a way to gather information from a user.
• Allow a user to submit feedback
• Allow a shopper to place an order for some sort of merchandise.
Form Processing• Forms do not process data they only
collect it.
• Processing must be done using a script.– Client Side – The script is on the client
machine (Possible problems?)– Server Side – The script lives on the server.
• Perl, VBScript, JavaScript, Java, or C++ are all examples of server side scripts
• Cold Fusion, ASP, ASP.NET, PHP, and Java Server are server side technologies.
Common Gateway Interface
• Also known as CGI
• Lives on the web server in the CGI-BIN folder.
• Script name is FormMail.pl
• Written in Perl
• Source code and ReadMe is available from the Reading Link on the class page
CGI Continued• The FormMail script will take the data
gathered in the browser and format it into an email message doing only minor validation of the data.
• The script will then email the data to the address in the hidden field recipient…
• Finally the script will redirect the user to a thank you page or another page. Why is this a good idea?
The FORM Tag
• Syntax <form>…</form>
• Parameters– Action – Path to the script– Method – get and post
• get sends the data in the URL, very limited• post sends the date very efficiently and is not as
limited as the get method
• Forms are displayed in Dreamweaver as a dotted red outline.
Windows XP SP2
• From now on the browser will hassle us about everything we do.
• This is a security feature and is really a good thing.
• IE6, IE7, Fire fox• Be sure to allow blocked content when
testing.• Great way to learn new and colorful words.• http://scsite.com/dw8/more.htm
More on Forms
Example Server Side Form
The Name and the Email Field must be named realname and email
Don’t confuse the field label with the name of the form object… They are often named the same…
The Mission• Build two versions of the Hotel Reservation
Form, Client and Server.• Label each page Client Side or Server Side right
below the horizontal rule and just above the form on each page.
• When your server side form is submitted the form page should be replaced by a page thanking the user for filling out the form.
• The Thank you page should be displayed for 15 seconds and then return the user to the page they came from.
Stuff You Will Need!
• Form Action:– http://chinook.kpc.alaska.edu/cgi-bin/FormMail.pl
• Hidden Fields– field_order – the order the information appears in the
body of the email– redirect – Full URL of a page to take the user when
submit is pressed– subject – Subject line for email sent– recipient – Your UAA email address