I'm wondering if there is a plugin which will be setting mask to the input, depending on which I have already input there.
For example if I set mask of an input to numbers from 0-4, and then write '1' to the input, I want be able to write only '0', '2', '3', '4'. I have already tried following mask plugins:
http://digitalbush.com/projects/masked-input-plugin/
but I only can achieve that, the whole input clear after write character, or the caret goes to the back of the input, or I'm not able to write anything. Here is my attempts to achieve what I want:
jQuery.mask.definitions['x'] = '[123456789]';
jQuery('#inputLabel').mask("x, x, x, x, x, x, x");
and if I input something to the input I tried this: setting mask one more time
jQuery.mask.definitions['x'] = returnDistinctTab(); //returnDistinctTab return tab without character which I have already input to the input.
var text = jQuery("#inputLabel").val();
text.replace('_', 'x');
jQuery('#inputLabel').mask('text');
If someone have an idea what I'm doing wrong, or knows mask which will be suitable for my case, I will be very grateful!!