Hi all, I am pretty new to VBscript. Can anyone help me convert the following JavaScript to VBScript:
<SCRIPT LANGUAGE="JavaScript">
function checkRequired_onsubmit() {
var returnValue = false;
var newValue;
if (document.theForm.textbox.value == ""
{
newValue = prompt("Reqired field 'My Text Box'. Please enter a value:", ""
;
document.theForm.textbox.value = newValue;
}
else {returnValue = true;}
return returnValue;
}
</SCRIPT>
And the associated form looks like this:
<FORM NAME="theForm" METHOD="POST"
ACTION="/examples/servlet/MyServlet" onsubmit="return checkRequired_onsubmit()">
With a submit like this:
<INPUT TYPE="submit" VALUE = "Update">
I also need to call another VBScript sub before returning to do the submit, let's say it name is 'sub doSomething'
TIA!!
<SCRIPT LANGUAGE="JavaScript">
function checkRequired_onsubmit() {
var returnValue = false;
var newValue;
if (document.theForm.textbox.value == ""
newValue = prompt("Reqired field 'My Text Box'. Please enter a value:", ""
document.theForm.textbox.value = newValue;
}
else {returnValue = true;}
return returnValue;
}
</SCRIPT>
And the associated form looks like this:
<FORM NAME="theForm" METHOD="POST"
ACTION="/examples/servlet/MyServlet" onsubmit="return checkRequired_onsubmit()">
With a submit like this:
<INPUT TYPE="submit" VALUE = "Update">
I also need to call another VBScript sub before returning to do the submit, let's say it name is 'sub doSomething'
TIA!!