I'm looking at the http://digitalbush.com/projects/masked-input-plugin/
I'm calling it like this:
$(control).mask('999-999-9999');
And I don't want it to throw away the users input if something is wrong, e.g. they haven't finished
[407-555-____]
If you leave the field after having typed this much, it clears it. I'd like to leave it so they can finish later.
I'm new to jQuery, and I've looked through his source, but I can't find any way to do that, nor can I find any way to edit it to accomplish what I want, because the code is arcane to my eyes.
Adding Placeholder could solve the problem.
Add an empty place holder into mask. see below
which would replace _ on the input text field by default. so there would bot be any _ left if the input length is dynamic and not fixed.
You should delete statement
input.val("");
incheckVal()
function for a proper solution.If you're using minified version, you should search and delete statement:
Try update file jquery.maskedinput.js
In function function checkVal(allow) set parameter allow on true. Its help for me.
Looking for into the pluging script the unmask method.
Set autoclear option to false.
In addition to removing the input.val("") in checkVal() you can also change the call to clearBuffer. In the original code it is: clearBuffer(0, len); removing all user input. if you change this to clearBuffer(lastMatch + 1, len); the user input will be displayed, followed by the mask placeholders that are still needed to complete correct input.
I have also added a user message in the .bind. This works for us, as we are using the MaskedInput for exactly one type of input. I'm checking for any input going further than position 7, because that's where the user input starts.
Here is what I did: