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
1 Answer
Reset to default 1try 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/