Top Banner
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

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.

Dec 26, 2015

Download

Documents

Christine Bates
Welcome message from author
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
Page 1: 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.

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

Page 2: 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.

Test ResultsA – 2B – 1C – 2D – 0F – 0

Not Taken – 0

Page 3: 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.

Two versions – Server Side and Client SideRequires 2 separate pages…

Page 4: 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.

Only the Client Side Version of this page

Page 5: 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.

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. :-)

Page 6: 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.

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.

Page 7: 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.

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.

Page 8: 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.

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

Page 9: 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.

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?

Page 10: 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.

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.

Page 11: 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.

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

Page 12: 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.

More on Forms

Page 13: 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.

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…

Page 14: 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.

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.

Page 15: 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.

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

Don’t freak out!!!There's more!!!

Page 16: 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.
Page 17: 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.
Page 18: 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.

<form action="http://chinook.kpc.alaska.edu/cgi-bin/FormMail.pl" method="post" name="MyForm“>

<input type="text" name="realname" size="50" maxlength="50">

<input type="text" name="email" size="50" maxlength="50">

<input type="checkbox" name="Enjoyed" value="Enjoyed the page!">

<input type="checkbox" name="GoodColor" value="Good Color">

<div align="center"> <input type="radio" name="sexbutton" value="Male"> <font face="Verdana, Arial, Helvetica, sans-serif">Male</font> <input type="radio" name="sexbutton" value="female"> <font face="Verdana, Arial, Helvetica, sans-serif">Female </font> <input type="radio" name="sexbutton" value="Other">Other </font> <input type="radio" name="sexbutton" value="Unknown">Don't Know</font></div>

<textarea name="comments" rows="5" cols="50"></textarea>

<input type="hidden" name="field_order" value="realname,email,Enjoyed,GoodColor,sexbutton,comments"><input type="hidden" name="redirect" value="http://chinook.kpc.alaska.edu/~inmej/thanks.htm"><input type="hidden" name="subject" value="Email Survey Form"><input name="recipient" type="hidden" id="recipient" value="[email protected]">

Page 19: 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.

The Thank-You Page

Page 20: 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.
Page 21: 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.
Page 22: 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.
Page 23: 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.

Click the Horizontal Rule text box and type horz_rule.

Click the W (Width) text box and type 500.

Tab to the H (Height) text box and type 10.

Click the Shading check box to deselect it.

Page 24: 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.

Forms and Objects in Them

Page 25: 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.

Forms are NOT Tables

• Forms can not be nested

• Forms can not be resized, they size themselves as objects are added.

• The form object is invisible when viewed in the browser.

• You can not display a forms borders.

Page 26: 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.
Page 27: 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.
Page 28: 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.

Form Name: Allows you to reference the form from a scripting language

Action: Defines how the form will be processed

Target: Specifies a window or FRAME in which to display data after the form is processed.

_blank – opens a new window_self – replaces contents of current windowThese may not work for forms and jump menus as described.

Method – How the form data is transferred to the server (post or get)

Enctype – MIME (Multipurpose Internet Mail Extensions) We will use text/plain forour mailto forms and nothing for the server side form…

Page 29: 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.
Page 30: 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.

Leave the Action field blank at this time

Page 31: 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.

Leave the Enctype blank at this time

Page 32: 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.
Page 33: 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.
Page 34: 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.
Page 35: 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.
Page 36: 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.
Page 37: 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.
Page 38: 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.

TextField – Assigns a unique name to the form object