Solved

VBScript question

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

Accepted Solution

by:
TrEaSoN earned 100 total points
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now