> > 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