Restrict which characters can be inserted into the field.
Also which keys can be used inside a field !
The field on the left has restricted everything else but numbers and spaces.
The ENTER and the RIGHT ARROW keys are disabled as well.
Furthermore, you can deselect the field by pressing the ESC key.
$('#testId4').tInput({
restrict : /[0-9 ]/g, // only numbers and spaces
noSpecialChars : [13], // disable the enter key
empty : {
text : 'Only numbers in here, sorry',
inputClass : 'tInput_Empty'
}
});
This field has only lowercase letters enabled (and spaces).
$('#testId4_2').tInput({
restrict : /[a-z ]/g, // only numbers and spaces
empty : {
text : 'only lowercase letters here man',
parentClass : 'tInput_Empty'
}
});
This is an email input. Any character that is not allowed in an email is disabled (including space);