Article ID: 152981
Article Last Modified on 11/17/2003
<HTML>
<Head><title>a test</title></Head>
<body>
<form name="vbtest">
<input type="button" Name="Button1" value="Press Me"
onclick="btnPress">
</form>
<Script language="VBScript">
sub btnPress
alert "you pressed the button"
end sub
</script>
</body>
</HTML>
Because the compiler reads the form definition first, it compiles the
onClick event into a JavaScript reference. When the button is clicked, the
interpreter tries to find the appropriate JavaScript function to execute.
However, the function is in a block of VBScript code and is not seen by the
interpreter as executable JavaScript code. Therefore, an "object doesn't
support the property or method" error results.
Additional query words: kbdse kndsi vbscript vbs
Keywords: kbscript kbfaq KB152981