Topic awaiting preservation: Form Validation madness (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: |
posted 07-10-2002 03:28
Alright I've this form with lots of checkboxes: code: <input type='checkbox' name='adam'>
code: <span>Name:</span><input type='text' name='name'>
code: function validator(theForm){
code: var myArray = new Array ('adam', 'bill', 'chad',...and so on);
|
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 07-10-2002 06:45
Usually what you need to do (and you may be doing this and not posting the code) but when you do a validator with a form field you need to return false to the onSubmit event handler. |
Bipolar (III) Inmate From: Amsterdam |
posted 07-10-2002 13:08
Wouldn't it just be easier to go through the validations, and if everything appears to be ok call formName.submit() ? |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 07-10-2002 13:33
Maybe so, but returning false to cancel the submission is more elegant. Also, it will work in browsers with Javascript turned off. |
Bipolar (III) Inmate From: |
posted 07-10-2002 14:47
Ahhhh! Yes. |