I
I
Ivan2016-05-19 21:36:26
css
Ivan, 2016-05-19 21:36:26

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');
          }
      },

Further
telephone: {
            	validators: {
            		callback: {
            			message: 'Введите номер телефона',
            			callback: function (value, validator, $field) {
                                               //Проверка на класс и если есть то все ок. но от не успевает прийти.
            					if ($($field).hasClass('complited')) {
            						return true;
            					} else {
            						return false;
            					}
            			}
            		}
            	}
            }


Can someone advise something?
Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question