Microsoft KB Archive/180825

= FP97: How to Use the Script Wizard with FrontPage =

Article ID: 180825

Article Last Modified on 2/27/2002

-

APPLIES TO


 * Microsoft FrontPage 97 Standard Edition

-



This article was previously published under Q180825



For a Microsoft FrontPage 98 version of this article, see 194063.



SUMMARY
You can add Microsoft Visual Basic Scripting Edition (VBScript) or JavaScript code to a Web page by using the Script Wizard. This article presents an overview of how to use the Script Wizard with Microsoft FrontPage.



MORE INFORMATION
The Script Wizard lets you select objects and associated events, and pick an action that will occur when an event takes place. After you make your selections, the Script Wizard creates the VBScript or JavaScript for you.

NOTE: Before you can use the Script Wizard in Microsoft FrontPage, you must install Microsoft Internet Explorer version 3.01 or later.

Running the Script Wizard

 * 1) In FrontPage Editor, open the Web page that contains the object you want to script.
 * 2) On the Insert menu, click Script.
 * 3) In the Script dialog box, click Script Wizard.

Components of the Script Wizard
The Script Wizard is divided into three panes:
 * Event pane
 * Action pane
 * Script pane

The Event Pane
The Event pane provides a hierarchical view of all of the objects and events on your page. It includes ActiveX Controls and HyperText Markup Language (HTML) forms.

The Action Pane
The Action pane provides a hierarchical view of the actions and properties you can use in the event handler, as well as the global variables and procedures defined for the page. When you double-click an action, the Script Wizard adds that action to the list in the Script pane. When you double-click a property, a dialog box asking you to select a value for the property appears. The type of dialog box that you will see, and the values that you can select will vary depending on the type of property you selected. After you have specified a value for a property, the Script Wizard will add that property to the list in the Script pane.

The Script Pane
The Script pane has two views: List view and Code view. You can switch between views by clicking the appropriate option at the bottom of the Script Wizard window.

You can use List view to assign simple actions to events or to set property values by using a point-and-click approach. If you want to use the power and full support of the scripting language, you can use Code view to write VBScript or JavaScript code.

Using the Script Wizard in List View:

If you script multiple actions for any given event, the actions will be executed in the order they appear in the list in the Script pane. You can use the Move Up and Move Down buttons to reorder the actions in the list.

To reorder the actions in the list, you can either insert or delete an action:
 * Click Insert Action. This will add the action that is selected in the Action pane to the list in the Script pane.

-or-
 * Click Delete Action. This will remove the action that is selected in the Script pane.

NOTE: If you specified a property, you can edit it by selecting the property in the Script pane and then clicking Modify Value.

Using the Script Wizard in Code View:

The Script pane displays the actual script in the default scripting language (VBScript or JavaScript) that you specified for the page. Click anywhere in the Script pane to edit your script.

Common Use for the Script Wizard
Following are some common uses for the Script Wizard.

Scripting to Link to Another Page

 * 1) In the Event pane of the Script Wizard, expand the object you want to script by clicking the plus sign (+) next to the object you want to script. When the hierarchy expands you will see all of the events for that specific object.
 * 2) Click the event you want to use as the source of your link. For example, select Click or onClick (depending on the type of object you selected).
 * 3) In the Action pane, double-click the Go To Page action. Do either of the following:
 * 4) * If you are working in List view, the Go To Page dialog box will appear. Type the Uniform Resource Locator (URL) for the destination page and click OK.

-or-
 * 1) * If you are working in Code view, click in the Script pane and type the URL of the destination page for the window.location.href = "" property.

Scripting to Hide or Show a Control

 * 1) In the Event pane of the Script Wizard, expand the object you want to script by clicking the plus sign (+) next to the object you want to script. When the hierarchy expands you will see all of the events for that specific object.
 * 2) Select the event that will initiate the Hide Control or Show Control action. For example, in the Event pane, select Click or onClick (depending on the type of object you selected).
 * 3) In the Action pane, expand the control you want to hide or show. The hierarchy expands so that you will see all of the actions and properties of that specific control.
 * 4) Double-click either the Hide Control or Show Control action.

Scripting to "Bring to Front" and "Send to Back"

 * 1) In the Event pane of the Script Wizard, expand the object you want to script by clicking the plus sign (+) next to the object you want to script. When the hierarchy expands you will see all of the events for that specific object.
 * 2) Select the event you want to reorder. For example, in the Event pane, select Click or onClick (depending on the type of object you selected).
 * 3) In the Action pane, expand the control that you want to reorder.
 * 4) Double-click either the Bring To Front or Send To Back action.

