M
M. Noroozi Eghbali
Hi,
In the asp file, I have a form and a validation function. The message box
opens while validating, but the form action is activated when the validating
is false. I could not find the problem. Any body can help me?
Here is the code:
----------------------------------
<script language="vbscript">
function Validator()
dim Result
Result = true
if len(document.InfoForm.T1.value) < 2 then
msgbox("Please enter your full name")
document.InfoForm.T1.focus
Result = false
end if
Validator = Result
end function
</script>
<form method="POST" name="InfoForm" onsubmit="return Validator()">
<input type="text" name="T1" size="32">
<input type="submit" value="Download" name="B1">
</form>
In the asp file, I have a form and a validation function. The message box
opens while validating, but the form action is activated when the validating
is false. I could not find the problem. Any body can help me?
Here is the code:
----------------------------------
<script language="vbscript">
function Validator()
dim Result
Result = true
if len(document.InfoForm.T1.value) < 2 then
msgbox("Please enter your full name")
document.InfoForm.T1.focus
Result = false
end if
Validator = Result
end function
</script>
<form method="POST" name="InfoForm" onsubmit="return Validator()">
<input type="text" name="T1" size="32">
<input type="submit" value="Download" name="B1">
</form>