Thanks for the reply, Joe...

To answer your question:  I want to check the required fields for any that are 
still
invalid after a user blurs out of any required field.

Rick

> -----Original Message-----
> From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On 
> Behalf Of Joe
> Sent: Saturday, January 03, 2009 10:15 PM
> To: jQuery (English)
> Subject: [jQuery] Re: How to check all required fields after each field is 
> filled...
> 
> 
> > > However, I want to be able to scan all required fields
> > > after each field is filled in and see if any required
> > > fields remain to be satisfactorily completed.
> 
> 
> 
> When do you want to "scan"?  After the user blurs out of the last
> input?  Or blurs out of any required input (because technically the
> user could skip around on the form)?
> 
> You obviously can't do it on submit because the button is disabled.
> 
> I have an idea of how to do it, but you need to dictate the event
> handler that is going to do trigger the scanning.
> 
> Joe
> 
> http://www.subprint.com
> 
> 
> 
> 
> On Jan 3, 6:17 pm, "Rick Faircloth" <r...@whitestonemedia.com> wrote:
> > Anyone?
> >
> >
> >
> > > I'm trying to validate a form.
> >
> > > All the validation I've implemented up to this point
> > > is working fine.
> >
> > > However, I want to be able to scan all required fields
> > > after each field is filled in and see if any required
> > > fields remain to be satisfactorily completed.  If there
> > > are any, I want to keep the submit button on my form
> > > disabled.
> >
> > > I'm trying to use this code:
> >
> > > $(':input.required').each(function() {
> > >      var val = (this.value.length);
> > >      if (val == 0)
> > >         { $('#submit').attr('disabled', 'disabled'); };
> > > });
> >
> > > However, each time I fill in a required field, the submit
> > > button is enabled.  (I realize for now that the code above
> > > is only checking length and I can add other checks later,
> > > but wanted to get this one working first.
> >
> > > Any clues?
> >
> > > Thanks,
> >
> > > Rick

Reply via email to