Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VBScript question

Posted on 1998-08-13
1
Medium Priority
?
298 Views
Last Modified: 2010-04-30
This is off the MSDN:
---------------------------------------------------
<CENTER>  
<P>  
<H2>Hello, world sample</H2>  
<INPUT TYPE=BUTTON VALUE="Click me" NAME="BtnHello">
</CENTER>
<SCRIPT LANGUAGE="VBScript">
<!--   Sub BtnHello_OnClick
      MsgBox "Hello, world!", 0, "My first active document"   End Sub-->
</SCRIPT>
------------------------------------------------
I cut and pasted this in and the OnClick doesn't run when
the button is pressed.Also, when IE first opens the page, the msgbox comes up... so it steps right through the code with no user input.
0
Comment
Question by:ds1964
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
TrEaSoN earned 400 total points
ID: 1468778
ds1964,
   Try this code instead...
---------------------------------------------------
<HTML>
<HEAD>
<TITLE> TrEaSoN'S Hello World Example! </TITLE>
<SCRIPT LANGUAGE = "VBScript">
<!--
    Sub cmdHello_OnClick()
       MsgBox "Hello, World!"
    End sub
-->
</SCRIPT>
</HEAD>
<BODY BGCOLOR = "White">
<FORM>
<INPUT TYPE = "BUTTON" NAME = "cmdHello" VALUE = "Click Me!">
</FORM>
</BODY>
</HTML>
-------------------------------------------------
If you have any further questions, just let me know.
-TrEaSoN-
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question