|
-
Mar 12th, 2006, 04:36 AM
#1
Thread Starter
Frenzied Member
Don't sumbit form if JS returns false?
On clicking submit i have to run a JS functio to see if all fields are filled in, well if there not i give a message box etc but the form still posts am using,
HTML Code:
<form method="POST" action="verify.php">
<input type="submit" value="Register" name="B1" onclick="checkfields()">
</form>
<script language = "javascript">
function checkfields(){
}
</script>
I need it not to post if any of the fields are empty
-
Mar 12th, 2006, 04:41 AM
#2
Re: Don't sumbit form if JS returns false?
Change it to
HTML Code:
onclick="return checkfields()"
And in your checkfields() function return TRUE to NOT post the form, FALSE to post it.
-
Mar 12th, 2006, 05:04 AM
#3
Thread Starter
Frenzied Member
Re: Don't sumbit form if JS returns false?
-
Mar 12th, 2006, 09:49 AM
#4
Re: Don't sumbit form if JS returns false?
No problems, don't forget to mark your thread as Resolved from the Thread Tools menu
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|