On Mar 16, 12:26 pm, Stephen Sadowski <d...@meta-meta.com> wrote:

> How about
> $('#form input,select,radio').change(function() { /* check to see if
> necessary fields are filled out, if so enable submit */}

Hi Stephen, thanks for your suggestion.

The problem with this approach is two-fold:

    1) This requires users to blur an element such as a textarea or
text input before the handler is fired, which is a bit unnatural. Most
users that I'm dealing with are not going to think "Oh I need to click
or tab away before that submit button is enabled," and

    2) It doesn't solve the problem of determining if the form
completely satisfies all the rules in a side effect-free manner.

The closest I've come to a solution is this:

    $('form').keyup(function(e) {
        if ( validator.checkForm() )
            $('#submitButton').removeAttr('disabled');
    });

But as I've noted in another post, calling #checkForm causes the form
to go "all wacky" warning of problems in input fields as soon as they
are focused, creating confusion and mayhem.

> It's pretty simple, but everything looked so complicated the ways you
> were trying.

I'd love to KISS, but desperate times call for desperate measures. I
really don't want to have to write my own validation logic, but I'm
just about to that point.

-dan

Reply via email to