twitter-bootstrap Bootstrap 输入掩码在动态文本框中不起作用?我能做什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27032350/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 21:53:39  来源:igfitidea点击:

Bootstrap Input Mask is not Working in Dynamic Textboxes? What can i do?

javascriptjquerytwitter-bootstrapdatejquery-inputmask

提问by Nithin Krishnan P

I tried this code also.But didnt get the out.

我也试过这个代码。但没有弄出来。

$(document).on("focus", ".date-picker", function () {       
   $(".date-picker").inputmask("dd-mm-yyyy", {"placeholder": "dd-mm-yyyy"});       
});

采纳答案by Nithin Krishnan P

try Using Jquery Mask instead on Bootsrtap input masking...It works very well

尝试在 Bootsrtap 输入掩码上使用 Jquery 掩码……效果很好

$("#btn").click( function (){       
       $("#content").append('<input class="date" type="text"></input>');       
    $(".date").mask("99/99/9999");       
});         
$(".date").focus( function (){       
      $(".date").mask("99/99/9999");      
});       

[Working Fiddle Demo] :http://jsfiddle.net/SEXAj/855/

[工作小提琴演示]:http: //jsfiddle.net/SEXAj/855/