Answer the question
In order to leave comments, you need to log in
jquery.inputmask integration with bootstrap validator?
Good evening.
The jquery.inputmask plugin has a callback(oncomplete) which is returned when the form is filled out correctly. And it needs to be somehow integrated into the bootstrap validator. I tried to intercept the class that was added after filling out the form using oncomplete. But the bootstrap validator works on the cob and then oncomplete. But it needs to be the other way around.
Below code
inputmask: {
definitions: {
'#': {
validator: "[0-9]",
cardinality: 1
}
},
showMaskOnHover: false,
autoUnmask: true,
oncomplete: function() {
//Добавляем класс
$(this).addClass('complited');
}
},
telephone: {
validators: {
callback: {
message: 'Введите номер телефона',
callback: function (value, validator, $field) {
//Проверка на класс и если есть то все ок. но от не успевает прийти.
if ($($field).hasClass('complited')) {
return true;
} else {
return false;
}
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question