PDA

You are currently viewing a search engine-friendly (archive) version of this page.

View Full Version : call VBscript in javascript


bw
November 26, 2001, 07:03 pm
Here is the scenario:
I have a button, that when clicked, will execute a javascript that either opens an alert box(created by vbscript) or sends the user to another page. However, I can't figure out how to call the vbscript from within the javascript.

I know nothing about vb scripts and only some javascripting. However, I found code for writing the customized alert box. But, it only said how to trigger the script from the <form type="button" name="entrance"> tag. There is no onClick event handler because it is part of the VBscript's name (sub entrance_onClick).

In the following javascript code I want to replace the else statment with a call for the vbscript (found at the bottom of the message).

<script language="javascript>
function checkCSS () {
if (css > 0) {
MM_goToURL('parent','insured.htm');
return document.MM_returnValue;
}
else {
NewWindow('viewcss.htm','cssWin','400','180','no') ;
return false;
}
}
</script>

<script language="VBscript">
Sub entrance_onClick
returnvalue=MsgBox ("Congratulations! You have just completed the section on Contract Roles. Return to the Course Contents where you may proceed with the next topic.",0,"Congratulations!")
If returnvalue=1 Then
window.location="../contents.htm"
Else
window.location="quiz8.htm"
End If
End Sub
</script>

TIA!!! <img src="confused.gif" border="0">

Tonker
November 28, 2001, 10:07 am
I don't even know if it's possible to do this. Hopefully someone else here will know how to do it if it's possible. I'm going move this to the Webmastering forum since I think the chances of someone knowing the answer to it will be greater there.

Here's the new link:
<a href="http://www.helpfromtechs.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=8&t=000348&p=" target="_blank">http://www.helpfromtechs.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=8&t=000348&p=</a>

[ November 28, 2001: Message edited by: Tonker ]</p>