Re: [jQuery] Validation and hidden fields problem

2007-03-20 Thread Jonathan Bloomer
Thats fantastic, I had no idea you could do that! You have just made my day thanks Mike :) On 20/03/07, Mike Alsup <[EMAIL PROTECTED]> wrote: > Did you try: > > $('div:not(:hidden) .required').each(... > > > get all elements that have the class 'required' as long as the > > container does not have

Re: [jQuery] Validation and hidden fields problem

2007-03-20 Thread Mike Alsup
Did you try: $('div:not(:hidden) .required').each(... > get all elements that have the class 'required' as long as the > container does not have the class 'hidden' but sometimes there are > loads of nested elements so its not always the parent as such. I've > tried 'filter' and 'not' but with suc

[jQuery] Validation and hidden fields problem

2007-03-19 Thread Jonathan Bloomer
I have a load of elements in a form hidden until the user activates it. I am using something like this: where the first div is hidden. I also have a required class on each element for validation purposes. This works like this: $('.required').each(function(i) { if ($(this).val() == "") {