feature suggestion: input mask

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

feature suggestion: input mask

FParsons
Just wondering - has this ever been considered as a future feature? I've used some jquery input masks like:

http://digitalbush.com/projects/masked-input-plugin/

What's nice about this is you can specify almost any pattern. Using this for dates, for example, means the user can't type a non-numeric character, and ranges can be specified for numbers.  It does prevent users from entering  something like "20xx-01-x1" or "3000-88-08" - it captures the key presses, they can't be entered. This filters out a whole class of non-sense before it's  even evaluated by the xforms engine. The plug-in mentioned above gives you an option on whether or not to use the "mask characters": like the parentheses and hyphen in "(555) 111-2222" (however, it seems to be tied to the jquery 'val' function).

I have seen the "US phone" xbl component.  However, this is pretty task specific.  I know that in xml schema you can specify a regex pattern and use xforms validation with alerts - you can validate it, but only after the text has already been entered.  Also, you don't have  the option to use helpful "mask characters" (like parentheses and hyphens) that don't become part of the value.

I looked at the YUI widgets, and apparently they don't offer something similar. I imagine this might be hugely complicated to implement, with very bad consequences if it didn't work correctly. I was just wondering what the Orbeon developer's thoughts on this might be.

-- Francis