Inputmask: input mask on modal window not working

Created on 18 Dec 2014  路  4Comments  路  Source: RobinHerbots/Inputmask

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?

Main

Most helpful comment

@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)

All 4 comments

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!!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SujayKrishna picture SujayKrishna  路  7Comments

richard-flosi picture richard-flosi  路  3Comments

blaskognia picture blaskognia  路  5Comments

kolyabokov picture kolyabokov  路  5Comments

TiGR picture TiGR  路  3Comments