7

Making it Go

Set the form up to work with a CGI script called a form handler.
DreamWeaver cannot write the script - the server end will do this. Many Internet Service Providers make available standard scripts for common forms, such as mail forms, and guestbooks, or consult your programmer, systems administrator, etc.

Forms are sent by either GET, which sends the results in the URL submitted to the script. or, POST which encodes the material sent to the script.

 

Check with your system admin to see which method you should use.

The script includes instructions on whether to store it in a database, e-mail it to someone or save it as a data file.

(You do not need to set up a form handler to run a jump menu which uses client side JavaScript that DreamWeaver writes for you).

Front End Interface Forms
Filling Out Forms

Purpose: You use forms
to get feedback about your site
:
to get details about the users' identities

Online shopping sites, visitor surveys and guest books all use forms to collect data or input.
This data is then sent to a form handler - usually a CGI script - which does something with this data.

Surveys:
The script saves the input for the site management to look at later.

Search Engines:
The script takes the input and immediately uses it to provide a response or result for the user.

Typically some form or interaction like a Thankyou Page assures the user that it hasn't lost the inputted information.

How to Create the Basics:

1 View>Visual Aids>Invisible Elements>On.
2 Insert>Form>Form or Click the Form Button on the tool bar.
The width of a form is 100% of the page by default.
The height is defined by the content.
You can format their content using tables.
3 Label each field in a form so users know what they are supposed to do.
4 Add the Form Objects

>Text Fields
or Text Boxes, single or multi-line

single line Text Field

>Checkboxes - Yes/No answers.

initial state checked Check Box


>Radio Buttons - allows you to choose one from a set of options

initial state checked radio button

>Lists and Menus (or dropdown menu)


>Submit Button/Reset Button

imagefield



>File Field Name



Each Form Field is an input item (in the code view you will see <input>, represented in form results by name and a value).

Use the Properties Inspector to edit your form tools. Double Click on the Form Field to display the properties.

Password Boxes. If you choose this option the user input will be shown as asterisks or bullets.

Organizing Forms using Fieldsets and Legends
A tag which you can use to group areas of a form together.
On a large form, one fieldset might include address information, another payment information, and another customer preferences.

To add the fieldset tag:
1 Select a group of form fields, including text and labels, in Code view.
2 Click the Fieldset button on the Forms category of the Insert bar. The Fieldset dialog box will appear.
3 To add a heading to your fieldset, using the <legend> tag, type a word or phrase in the Label text box. This label will show up in browsers that are able to display this tag.
4 Click OK.
The selection will be surrounded by the <fieldset></fieldset>tag. In Internet Explorer 4 and later and Newscape 6, a fieldset is defined with a visible line.

NB: If you are using tables to lay out your form, you probably want to confine your fieldset to a single table cell

Feedback Box. A multi-line text box.

You can set a character limit for a single-line text field eg. credit cards have 16 digits, or 19 with dashes; passwords; 'phone numbers; postcodes.


 

.

To set up a form handler

1 In document window, select your form by clicking on the dashed border around it.
2 Choose the method and action of the form handler in the Properties Inspector.

* Click the Method drop down menu - choose GET or POST.

* In the Action box type the URL of the CGI or other script that will be processing the form>

* Press Enter (Return)

You won't see any changes in the document window, but you can look at the HTML to see that they are there.



Add e-commerce to your site by using Pay-Pal.

Sign up for a merchant account @ PayPal.
Add a Buy Now button to your site.

NEVER SEND A CREDIT CARD NO. using GET.

It is not encoded, only use GET for small forms, containing non sensitive data.

'Enctype' on the Properties Inspector is to be used if you are encoding data in the POST method.