Skip to content

onFieldSuccess and addSuccessCssClassToField never fire for successfully ajax validated field #583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
duwaned opened this issue Jan 13, 2013 · 2 comments

Comments

@duwaned
Copy link

duwaned commented Jan 13, 2013

Hi.

New to GH so excuse if I mess up code formatting.

I have been doing some testing with latest version (2.6.2) and it seems that both onFieldSuccess and addSuccessCssClassToField never fire on a field validated using ajax. In my case this is a username uniqueness check. My VE declaration is as follows:

    $("#regform").validationEngine('attach', {
        promptPosition: "topRight",
        addSuccessCssClassToField: 'passval',
        addFailureCssClassToField: 'failval',
        autoPositionUpdate: true,
        autoHideDelay: 3000,
        autoHidePrompt: true,
        validationEventTrigger: 'blur',
        ajaxFormValidation: true,
        ajaxFormValidationMethod: 'post',
        onFieldSuccess: function () {
            alert('bob');
        }
    });

I can see the failure class ('failval' in my case) being added to the ajax field before the ajax validation kicks off on blur but it is never removed (and success CSS class is never added) even when the ajax validated response is received as valid. All other non ajax validated fields work fine.

Also I tried to use the onFieldSuccess callback to possibly remove the failure class from the ajax field but this too is not called even when the ajax field validates. It works on other non ajax validated fields.

The declaration of my HTML input to be validated using ajax is as follows:

 <input type="text" name="uname" id="uname" value="" maxlength="16" autocomplete="off" class="validate[required,custom[onlyLetterNumber],minSize[3],maxSize[16],ajax[ajaxUserCallPhp]]"/>

The ajax validation side of things works well however it seems the success and failure events are not processed for ajax validated fields based on the ajax response received. Can anyone else confirm this please?

Thanks.

Regards.
Duwane

@duwaned
Copy link
Author

duwaned commented Jan 13, 2013

Just confirmed that if I change the validationEventTrigger to 'submit' it works so seems something isn't being kicked off for an individual field validation.

@TroyWitthoeft
Copy link

See #608

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants