hi~
I would like to express a mask depends on the phone number digits.
ex : 010-123-1234, 010-1234-1234
So I looked create the code.
$("#Phone").jqxMaskedInput({
width : 150,
height : 30,
mask:'###-###-####',
}).on('valueChanged', function(e){
var val = e.args.value.replace(/[^0-9]/g,'');
console.info(val);
if( value.length < 11 ){
$("#Phone").jqxMaskedInput({ mask:'###-###-####',value : val }); // 10 digit
}else{
$("#Phone").jqxMaskedInput({ mask:'###-####-####',value : val }); // 11 digit
}
});
https://jsfiddle.net/jqwidgets/sNbe7/
I do not know whether the cursor is always the last thing …