Solved

VBScript question

Posted on 1998-08-13
1
284 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 100 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

738 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