Skip to content

Remote validation deletes previous validation errors #1375

Closed
@florianengel

Description

@florianengel

If one element on a page is validated using the remote validation method, the validation errors of previous elements get lost.
Since I wasn't able to provide a working example on jsfiddle or jsbin, which actually does a remote call, I put the demo here: http://bit.ly/14Xt9Da

If you leave all 3 input elements empty, the required rule for the first and third element works correctly, since the remote validation doesn't get triggered. If you fill something in the second field, only the validation message for the third one shows up. (the true.php returns true for every input).
This behavior occurs also in the latest version 1.13.1.

During the remote success handling the function prepareElement() gets called, which will then call this.reset();

        reset: function() {
            this.successList = [];
            this.errorList = [];
            this.errorMap = {};
            this.toShow = $( [] );
            this.toHide = $( [] );
            this.currentElements = $( [] );
        },

Particularly the this.errorMap = {} seems to cause the problem here. Till the validator reaches the statement, it holds all the previous errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions