Thread: Forms
View Single Post
  #12 (permalink)  
Old 03-19-2004, 04:36 PM
alienzhavelanded alienzhavelanded is offline
WebProWorld Pro
 
Join Date: Sep 2003
Location: Mars
Posts: 171
alienzhavelanded RepRank 0
Default

From the Dreamweaver help file: (Items relating to the subject are in bold)

Attaching custom scripts to HTML form buttons
Some forms use JavaScript or VBScript to perform form processing or some other action on the client as opposed to sending the form data to the server for processing. You can use Dreamweaver to configure a form button to run a specific client-side script when the user clicks the button.

Note: This feature does not work with ASP.NET forms.

To run a script on the client:
Select a Submit button in a form.
In the Behaviors panel (Window > Behaviors), click the Plus (+) button and select Call JavaScript from the list.
For more information on this behavior, see Call JavaScript.

In the Call JavaScript text box that appears, enter the name of the JavaScript function you want to run when the user clicks the button, and click OK.
For example, you can enter the name of a function that doesn’t exist yet, such as processMyForm().

If your JavaScript function doesn’t exist in the head section of the document yet, add it now.

For example, you could define the following JavaScript function in the head section of the document to display a message when the user clicks the Submit button.

function processMyForm(){
alert('Thanks for your order!');
}

In addition, FrontPage users have it even easier if theyre working with a FrontPage web using FP 2002 with Server Extensions and/or FP 2k3 with Sharepoint/Extensions. A nice benefit of 2k3/Sharepoint is the ability to save your form results as XML as well ;)

You simply create your form, then right click anywhere in the form> choose Form Properties>Under "Where to Store Results" , fill in the Email Address: field.

The Advanced button offers a few more options for processing as well. Hope this helps. FP haters should check out 2k3, btw...HUGE improvement.

Happy coding,
The Martian
Reply With Quote