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">
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">