Solved

VBScript question

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…

729 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