JavaScript allows you to add interactive elements to and perform scripted functions on Web pages. Adding JavaScript in Dreamweaver 8 is not difficult, and does not require you to know JavaScript programming.
In Dreamweaver 8, JavaScript is a "behavior" and is controlled through the Behaviors panel. You'll use the Behaviors panel when adding JavaScript in Dreamweaver 8 to a Web page you're working with.
To open the Behaviors panel, select Windows> Behaviors. Select the + button to activate a drop-down menu. The Add Behaviors drop down menu contains about two-dozen common JavaScript-controlled functions you may add to a page in Dreamweaver. Common functions like checking browser types and revisions, checking for a plug-in, displaying a Pop-up message, validating a form or going to a URL are examples of JavaScript behaviors you may add.
Each behavior in the Add Behaviors menu has a dialogue box that enables you to specify the actions that should take place when a certain trigger is encountered. A trigger is an action that a visitor to your web site may perform, such as clicking on a link, entering data into a form or mousing over a particular location on the page.
You'll find the Validate Form behavior useful if you collect typed information from your visitors. The Validate Form behavior can use to verify that data entered by a visitor is in the correct format or contains only valid data. Once you have configured the behavior appropriately, select OK.
If the behavior you want to add is not among the built-in JavaScript behaviors, you may select Get More Behaviors. This selection will take you to the Macromedia Dreamweaver Exchange Site. Here you'll find user-created JavaScript behaviors that you may download. One caution: not all behaviors at this location are free of charge, but you'll find that adding new behaviors to your Dreamweaver interface is easy when you visit this site.
You may also change a behavior you have added to Dreamweaver 8. To modify an existing behavior, find the behavior you want to edit in Code View. Select it and it will appear in the list below the Add Behaviors button in the Behaviors panel. From this point, you may modify the order in which events occur, change the event that triggers an action or delete the behavior altogether.

