Forum Moderators: open
If you use <input type="button"> for your submit and Javascript is disabled, it will do . . . nothing. If you use <input type="submit"> it will submit even if required fields are left blank.
I still think it's a good thing, so long as it's not dependent on JS to do it's thing. For example,
<form onSubmit="return false;">
<input type="submit" onClick="checkFields(this.form);" value="go">
</form>
<script language="Javascript">
function checkFields (form) {
//screen . . .
if (err) { alert(msg); }
else { form.submit(); }
}
</script>
If Javascript is off - this form will submit. If not, it will alert any invalid fields and NOT submit. So you've added an "option" that will work in both cases. The return false only stops submission if Javascript is enabled, see?
So sadly, it's required that you screen the same data on the server side. While this is duplication of services, you have to remember that Javascript is an optional feature to enhance the user's experience. If it works, it saves them a back button click if they can't read (we said email is REQUIRED, what where you thinking? :-D )