I have create my own Bootstrap validator:
$('.myValidatorClass').validator({
custom: {
'datainizio':function($el){
return dataInizio($el);
}
},
errors: {
datainizio: "error"
}}).on('submit', function (e) {
// code
}
})
The method dataInizio() check if a "start date" field is filled when a "end date" field is filled; it works.
this is the end date field:
<input id="endDate" nama="endDate" data-datainizio="datainizio" />
<div class="help-block with-errors"></div>
Now, I need to programmatically (I suppose) call the validator when the value of the "start date" field changes, in order to remove the errore message in the form.
I read this page, and used $("#form").validator('validate')
, but the error messages are not deleted on the page. It seems Bootstrap validator calls only its own "validation methods" and not also my "validation methods" like datainizio
Thank you in advance.