Forum Moderators: open
In the past I would typically do something along the lines of using:
<form id="post_form" name="post_form" onsubmit="check(); return false;" action="/script/process.php" method="post"> Where check() validates various fields. Problem with this is that when javascript is disabled, the form can still be submitted, due to using the type="submit" button.
A quick a dirty solution would be switching to a type="button" 'submit' button, but the problems that arise from that are that the onsubmit event of the form tag won't fire, so I'll need to move the validation code to the onclick event of the new button. This should do it, but then the form can only be submitted by a mouse click, and not by enter or tabbing to the button and using a keypress... any suggestions?
Thanks,
P