FP98: How to Use the Script Wizard with FrontPage
ID: Q194063
|
The information in this article applies to:
-
Microsoft FrontPage 98 for Windows
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
- In FrontPage Editor, open the Web page that contains the object you
want to script.
- On the Insert menu, point to Advanced, and then click Script.
- 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
- 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.
- 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).
- In the Action pane, double-click the Go To Page action. Do either of
the following:
- 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-
- 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
- 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.
- 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).
- 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.
- Double-click either the Hide Control or Show Control action.
Scripting to "Bring to Front" and "Send to Back"
- 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.
- 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).
- In the Action pane, expand the control that you want to reorder.
- Double-click either the Bring To Front or Send To Back action.
REFERENCES
For more information about using Microsoft Forms 2.0 ActiveX Controls in
FrontPage, please see the following articles in the Microsoft Knowledge
Base:
Q171673 FP97: How to Use Microsoft Forms 2.0 ActiveX Controls
Q180822 FP98: How to Use Microsoft Forms 2.0 ActiveX Controls
Additional query words:
fpedit jscript vbscript ie 98
Keywords : fpedit fpactive fpscript
Version : WINDOWS:
Platform : WINDOWS
Issue type : kbinfo
Last Reviewed: July 27, 1999