Macromedia dreamweaver 8-using dreamweaver User Manual

Page of 1030
Attaching custom scripts to HTML form buttons
815
Attaching JavaScript behaviors to HTML 
form objects
You can attach JavaScript behaviors stored in Dreamweaver to HTML form objects such as 
buttons.
To attach a JavaScript behavior to an HTML form object:
1.
Select the HTML form object.
2.
In the Behaviors panel (Window > Behaviors), click the Plus (+) button and select a 
behavior from the list.
For more information, see 
.
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. 
To run a script on the client:
1.
Select a Submit button in a form.
2.
In the Behaviors panel (Window > Behaviors), click the Plus (+) button and select Call 
JavaScript from the list.
For more information on this behavior, see 
3.
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()
.
NO
TE
This feature does not work with ASP.NET form controls because these controls are 
processed on the server.
NO
TE
This feature does not work with ASP.NET forms.