
August 17th, 2003, 09:25 AM
|
 |
God Among Men
|
|
Join Date: Mar 2003
Posts: 160
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Q regarding VBScript and validating forms
I was wondering how to validate forms with VBScript. I want to use the onSubmit event handler and to make not submit if there was a problem
ie...in Javascript you can just put:
Code:
<body>
<script language="Javascript">
<!--
function validate(obj){
if (obj.name.value == ""){
alert("Please fill in the form");
return false;
}
return true;
}
-->
</script>
<form name="form" method="post" action="somefile.cgi" onSubmit="return validate(this)">
<input type="text" name="name">
<br><input type="submit">
</form>
</body>
But how would you give the same result using VBScript?
Thanks, Tom
|