Hello,
I was trying to add input mask on modal window. Modal window is loaded after the page is rendered. Validation is working. But data-mask not. Something wrong?
You need to call inputmask again to enable it on the new added fields. I chose this approuch to leave the dev the freedom of how to implement and integrate.
Can you please help me where i am doing wrong...i put below code in the modal windows as well as in the main file
<script>
$(function() {
$("#datemask").inputmask("dd-mm-yyyy", {"placeholder": "dd-mm-yyyy"});
$("[data-mask]").inputmask();
});
</script>
@webmastervinay ,
In you main page, not the model do something like.
$(":input").inputmask();
$(document).on("ajaxComplete", function(e){
$(":input").inputmask();
});
This initializes the inputmask onload of the page and after each ajaxrequest (loading your modal)
thanks a lot author!!! you saved a lot of time of mine!!!
Most helpful comment
@webmastervinay ,
In you main page, not the model do something like.
This initializes the inputmask onload of the page and after each ajaxrequest (loading your modal)