Mask For One Digit And Two Digit
I have been using this $('#SomeId').mask('99'); jquery mask for text box where I want to enter only two digit numbers, but i do not know which mask to put in order to enable enter
Solution 1:
{mask: 9, 'maxLength': 2} should work
Edit: you have not specified what mask have you used; my answer is related to meioMask plugin.
Edit 2: for maskedinput 1.2.2:
$("#SomeId").mask("9?9");
Solution 2:
<html><head><scriptsrc="http://code.jquery.com/jquery-1.11.0.min.js"></script><scripttype="text/javascript">
$(document).ready(function(){
$('#test').keypress(allowOnlyTwoPositiveDigts);
});
functionallowOnlyTwoPositiveDigts(e){
var test = /^[\-]?[0-9]{1,2}?$/return test.test(this.value+String.fromCharCode(e.which))
}
</script></head><body><inputid="test"type="text" /></body></html>
Solution 3:
<inputid="id_input"class=".class_input"type="text" />
$('#id_input').mask('99');
$('.class_input').mask('99');
Post a Comment for "Mask For One Digit And Two Digit"