How To

How to Use the VBScript Event Object

Contributor
By eHow Contributing Writer
(1 Ratings)

Retrieve more information about an event that has occurred, with the VBScript event object embedded in the event handler logic. The event object returns many types of information, some are set codes and others are Boolean string. Use this information to help you understand what buttons are being used on your web page or application.

Difficulty: Moderately Easy
Instructions
  1. Step 1

    Type "event.command" into your function. Then type "event.returnValue=" and then a true or false after the equal sign, depending on how you expect your event to work. The script returns a value for your viewing.

  2. Step 2

    Read the event objects return of information. If used with the "altKey," "shiftKey" or "ctrlKey," the object returns a Boolean that displays when the object kicked off. If used with the "button," the object returns which mouse button the user pressed.

  3. Step 3

    Embed the "EVENT=command" then "LANGUAGE='vbscript'" in your start up for your event handler to use. Input a specific command, such as when a certain button presses after "EVENT=." The VBScript runs after the command finishes. Exchange "EVENT=command" for "eventname='method'" to use all the commands in your method instead of one specified command to execute and track.

  4. Step 4

    Use the event object to specify what event with what object you want to execute. Follow this code structure in your VBScript "language='VBscript' for='ObjectName' event='EventName'" and the rest of your script logic you want to execute after you have fetched your object and event handler.

Post a Comment

Post a Comment
  • Have you done this? Click here to let us know.
I Did This

Related Ads

Internet
Virginia DeBolt,

Meet Virginia DeBolt eHow's Internet Expert.

Get Free Internet Newsletters

Copyright © 1999-2009 eHow, Inc. Use of this web site constitutes acceptance of the eHow Terms of Use and Privacy Policy.   en-US

Demand Media
eHow_eHow Technology and Electronics