How do I make a Trigger for angular-input-masks validation?

Asked

Viewed 51 times

0

I have a field :

<input type="text" name="DataNascimento" class="form-control data"
    ng-model="EscolherCurso.DataNascimento" required ui-date-mask/>

which I preferred to use jquery datepicker. But when jQuery fills the value, the angular does not perform the validation again.

I tried to use the datepicker event :

onSelect: function (dateText) {
        $(this).val(dateText);
            if ($(this).valid()) {
                $(this).removeClass('invalid').addClass('success');
            }

    }

but did not fire.

  • Forehead shoot .trigger('input'); in that element

  • It didn’t work for me, I tried Rigger('input'), Rigger('change'), triggerHandler('change') ... and nothing

  • You tested $('[name="DataNascimento"]').trigger('input'); within that onSelect and it didn’t work?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.