Skip to content
This repository was archived by the owner on Mar 12, 2020. It is now read-only.
This repository was archived by the owner on Mar 12, 2020. It is now read-only.

strange behaviour between showErrors & clearErrors on non-native select #251

@maximelebreton

Description

@maximelebreton

Hi @1000hz, and thanks a lot for the work!

I use Bootstrap select, and have a little problem.
First, i have to made this little modification (because bootstrap-select hide the native select):

$.fn.validator.Constructor.INPUT_SELECTOR = ':input:not([type="submit"], button):enabled'

And it works.

But, when i have errors, there is no .has-error class on the parent .form-group and no .help-block messages.
I don't understand because the markup is in the right place:
image

And in the Validator.prototype.showErrors function, the variables $group, $block and errors are good.

So the problem seems to be in Validator.prototype.clearErrors function, who's called at the same time !?

If i comment the code:
image

it works...
image

Any idea?

Thanks!


EDIT 1:

i've made a JSBin, and it's working with one element.
http://jsbin.com/qorinewoyi/edit?html,output


EDIT 2:

Ok, i have reproduced the problem, it's when you have more than one element, it keep only the last one:
(and if I comment the clearErrors function, this behaviour disapear)
http://jsbin.com/javihugewa/edit?html,output

any idea of how to fix this?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions