H
How to control onsumbit in VBScript
Hi,
Is it possiable to control the onsubmit function in VBScript?
For example, I have a form with only one check box. I like to verify the
check box on checked before to send the email out. If the check box do not
check, display the message to user. The verify function will like following:
Java Script
function ValidateForm(chkbx)
{
if(chkbx.checked == true)
{
return true
}
else
{
window.alert("Please check on the check box.");
return false;
}
}
Then I can use the onsubmit="return ValidateContactForm();" to make it work
(The email send out or not is controled by function return false or true).
But in VBScript, I have to write the function as following:
Public function ValidateForm()
if chkbx.checked = true then
ValidateForm = true
else
ValidateForm = false
end if
end function
Then I only can use the onsubmit="ValidateContactForm()" to make it work
(The email will send out whatever function return false or true).
I get compile error when I try to following cases:
onsubmit="retun ValidateContactForm()"
onsubmit="ValidateContactForm() = true"
Please help me to find where I am wrong.
Thanks,
Xiao
Is it possiable to control the onsubmit function in VBScript?
For example, I have a form with only one check box. I like to verify the
check box on checked before to send the email out. If the check box do not
check, display the message to user. The verify function will like following:
Java Script
function ValidateForm(chkbx)
{
if(chkbx.checked == true)
{
return true
}
else
{
window.alert("Please check on the check box.");
return false;
}
}
Then I can use the onsubmit="return ValidateContactForm();" to make it work
(The email send out or not is controled by function return false or true).
But in VBScript, I have to write the function as following:
Public function ValidateForm()
if chkbx.checked = true then
ValidateForm = true
else
ValidateForm = false
end if
end function
Then I only can use the onsubmit="ValidateContactForm()" to make it work
(The email will send out whatever function return false or true).
I get compile error when I try to following cases:
onsubmit="retun ValidateContactForm()"
onsubmit="ValidateContactForm() = true"
Please help me to find where I am wrong.
Thanks,
Xiao