I have a situation in a survey where users are entering codes in a Multiple Short Text Field. Some of the fields need to be formatted so that the values are a fixed width (5 digits), left padded with zeros when necessary, others can except any word or brief phrase, or be left blank.
I can do this with jquery in the onchange event AFTER the numeric part is entered, but it would be easier and less error prone if users could see the values correctly as they enter them, so for example if the code is "1234" the user would see this as they type:
00000
00001
00012
00123
01234
filling the digits in from the right like a calculator, but keeping the width fixed with zero-padding on the left.
Last edit: 8 years 7 months ago by jlwood. Reason: small typo
Thank you Tony, this is working like a charm, and fixing a few other challenges to boot. I'd tried a couple of other simpler masking utilities without success but this did the trick.