Mariano
Mariano

Reputation: 11

Bootstrap Validator revalidate

I'm trying to assign a value to an input box using:

$("button").click(function(){
    $("input:text").val("Glenn Quagmire");
}); 

This works OK but Bootstrap Validator doesn't see the value change, if I enter something using keyboard BV validates the new value. I'm using this version http://cdnjs.cloudflare.com/ajax/libs/bootstrap-validator/0.4.5/js/bootstrapvalidator.min.js

thanks

Upvotes: 1

Views: 1262

Answers (1)

Larissa Masson
Larissa Masson

Reputation: 41

I'm use this:

$("#input").val('text');
$("#input").change(); 

I guess the validator only works when the 'change' event is called, so I forced this event and it works.

Upvotes: 2

Related Questions