FP: How to Use The Script Wizard With FrontPage

Last reviewed: March 18, 1998
Article ID: Q180825
The information in this article applies to:
  • Microsoft FrontPage 98 for Windows
  • Microsoft FrontPage 97 for Windows with Bonus Pack

                                 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 FrontPage 97, you must install Microsoft Internet Explorer version 3.01 or later. You do not need to install Internet Explorer to use the Script Wizard in FrontPage 98.

Running the Script Wizard

FrontPage 98

  1. In FrontPage Editor, open the Web page that contains the object you want to script.

    NOTE: The pointer can be positioned anywhere on the page because the Script Wizard automatically inserts the script at the proper place.

  2. On the Insert menu, point to Advanced, and click Script.

  3. In the Script dialog box, click Script Wizard.

If you have an ActiveX Control on your page, you can right-click the control and then click Script Wizard on the menu that appears.

FrontPage 97

  1. In FrontPage Editor, open the Web page that contains the object you want to script.

    NOTE: The pointer can be positioned anywhere on the page because the Script Wizard automatically inserts the script at the proper place.

  2. On the Insert menu, click Script.

  3. In the Script dialog box, click Script Wizard.

If you have an ActiveX Control on your page, you can right-click the control and then click Script Wizard on the menu that appears.

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 will appear. 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 double-clicked. 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:

    - 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
         then 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

  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 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. Click 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.

                                     REFERENCES
                                     ==========
    
    
For more information about using Microsoft Forms 2.0 ActiveX Controls in FrontPage, please see the following articles in the Microsoft Knowledge Base:

   ARTICLE-ID: Q171673
   TITLE     : FP97: How to Use Microsoft Forms 2.0 ActiveX Controls

   ARTICLE-ID: Q180822
   TITLE     : FP98: How to Use Microsoft Forms 2.0 ActiveX Controls


Additional query words: fpedit jscript vbscript ie 97 98
Keywords : fpedit fpscript fpactive kbdta
Technology : kbinetdev internet
Version : WINDOWS:97,98
Platform : WINDOWS
Hardware : x86
Issue type : kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 18, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.