I'm completed the direct port of Josh Bush's maskedinput plugin
(digitalbush.com) to the jq-ui widget framework. I've also added a few
modifications that I made to his original script; most notably
allowing partial input and the ability to apply the mask to non-input
elements.
( As discussed @
http://groups.google.com/group/jquery-ui-dev/browse_thread/thread/cbea8bb21df8b9be/0b052693861b61cb?lnk=gst&q=maskedinput#0b052693861b61cb
)
You can find it at http://jquery-ui.googlecode.com/svn/branches/dev/mask.
The demo for it is located at
http://jquery-ui.googlecode.com/svn/branches/dev/mask/demos/mask/index.html
The source file is located at
http://jquery-ui.googlecode.com/svn/branches/dev/mask/ui/ui.mask.js
I've run this through the ringer on IE 7, Firefox 3.0.7 and the latest
versions of Opera, Safari and Chrome. My VPC is acting up at the
moment, so I havent been able to get testing done on IE6 or IE8. I
would greatly appreciate some more eyes on this. Please also feel free
to add more demos. I'm not sure who to ask or who to go to, but if the
testers could beat this plugin up, it would be greatly appreciated.
I'd love to see this mature to the point that we could include it in
1.8.
Thanks,
Andrew
Scott, should all widgets be coded like this? If so, these points
> - try to remove all browser checks
> - plugins must work regardless of what options are passed (don't bail out of init - just because a plugin in instantiated without a mask doesn't mean it won't be modified to have one later)
> - you must use jQuery.ui.keyCode instead of numeric values
> - you should use full variable/function names, don't use abbreviations, e.g., options instead of opts
> - there shouldn't be an event that will destroy an instance
(and any others like them) should be added to the Developer Guide
(http://docs.jquery.com/UI/Developer_Guide).
Should this plugin actually use several inputs that look like one and keep the original input updated as the user types (perhaps even make it hidden)?Anyone have any thoughts on this?
@ Scott J, Richard
I've done very little work with accessibility on the web. So please do
share your experience here. If we can do something to make this easier
for people, that would be great. Are we worried about about screen
readers in the input or output sense?
@ Scott G.
How do we resolve issues where only one browser effects functionality?
127 represents backspace only on the iphone. Catching the same keycode
for other browsers would be incorrect in that context.