Hi for my script i must use jquery.inputmask but I have a problem with the input field selection. I can't use ids (because of other script) so I tried this:
var FormComponents = function () {
var handleInputMasks = function () {
$.extend($.inputmask.defaults, {
'autounmask': true
});
$(":input").inputmask("99999.99999.99999", {placeholder:" ", clearMaskOnLostFocus: true }); //default
}
return {
//main function to initiate the module
init: function () {
handleInputMasks();
}
};
}();
All work but now all inputs have the inputmask. But I only want to have the input with the css class inputmask
.
So I tried
$(".inputmask input[type=text]").inputmask("99999.99999.99999", {placeholder:" ", clearMaskOnLostFocus: true }); //default
and
$(".inputmask :input").inputmask("99999.99999.99999", {placeholder:" ", clearMaskOnLostFocus: true }); //default
but both are not working. Anybody an idea?
Put your class after your element selector:
or else just use the class with no element: