最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Bootstrap Input Mask is not Working in Dynamic Textboxes? What can i do? - Stack Overflow

programmeradmin1浏览0评论

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"});       
});

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"});       
});
Share Improve this question edited Jul 3, 2015 at 8:50 Siguza 24.1k6 gold badges55 silver badges99 bronze badges asked Nov 20, 2014 at 5:23 Nithin Krishnan PNithin Krishnan P 7581 gold badge6 silver badges14 bronze badges 6
  • instead of $(".date-picker") try $(this) – Kartikeya Khosla Commented Nov 20, 2014 at 5:24
  • I tried that also....:( – Nithin Krishnan P Commented Nov 20, 2014 at 5:25
  • getting any errors in console??? – Kartikeya Khosla Commented Nov 20, 2014 at 5:25
  • Uncaught TypeError: undefined is not a function [ undefined function input mask] – Nithin Krishnan P Commented Nov 20, 2014 at 5:31
  • this means inputmask method is not defined in boostrap or you are using it wrongly. – Kartikeya Khosla Commented Nov 20, 2014 at 5:32
 |  Show 1 more ment

1 Answer 1

Reset to default 1

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

$("#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/SEXAj/855/

发布评论

评论列表(0)

  1. 暂无评论