[jQuery] Re: problem with using .each() in forms validation

2009-02-25 Thread David Muir
validate_form() isn't returning a value, so it won't stop the submit. your return clauses are within the closure for the each method, so they're not being passed down. You'll need to do something like this: function validate_form() { var pass = true; $("select[id^='products']").each(fun

[jQuery] Re: problem with using .each() in forms validation

2009-02-25 Thread David Muir
Shouldn't your onSubmit handler be: onSubmit="return validate_form();" or $('form').submit(function(){return validate_form();}); Cheers, David James wrote: So what happens if your validate_page() is only: function validate_form() { return false; } Does it submit? On Feb 25, 2:31 pm,

[jQuery] Re: problem with using .each() in forms validation

2009-02-25 Thread Mahmoud M. Abdel-Fattah
yes, it does. On Feb 26, 2:36 am, James wrote: > So what happens if your validate_page() is only: > > function validate_form() { >      return false; > > } > > Does it submit? > > On Feb 25, 2:31 pm, "Mahmoud M. Abdel-Fattah" > wrote: > > > no, there isn't any error! > > I did removed return fa

[jQuery] Re: problem with using .each() in forms validation

2009-02-25 Thread James
So what happens if your validate_page() is only: function validate_form() { return false; } Does it submit? On Feb 25, 2:31 pm, "Mahmoud M. Abdel-Fattah" wrote: > no, there isn't any error! > I did removed return false; from onSubmit handler , but nothing new !! > the form proceed to subm

[jQuery] Re: problem with using .each() in forms validation

2009-02-25 Thread Mahmoud M. Abdel-Fattah
no, there isn't any error! I did removed return false; from onSubmit handler , but nothing new !! the form proceed to submit without STOP ! the alert appears & when I click ok, it goes to the next page with no stop ! Thanks for your time, Mahmoud Abdel-Fattah On Feb 26, 2:12 am, James wrote: >

[jQuery] Re: problem with using .each() in forms validation

2009-02-25 Thread James
Are there any errors that returned? Usually it's a JS error the cripples the code and makes it submit regardless. What happens if validate_form() only contains "return false"? Does it not submit? You should probably remove the "return false" on the onsubmit handler or else it'll never submit sinc