i think personally that indeed a callback onError, that is called when the input loses focus would be great. from thereon, the user can defines what to do. for instance, as a UI developer, i would add a "error" class to the wrapping div, and add "Incomplete data" message to the right of the input. But another would go as far as alert("missing data you moron !!") . At least my desk neighbour would, he's so uneducated :)
On Mon, Dec 22, 2008 at 4:25 PM, Josh Bush <josh.b...@gmail.com> wrote: > > Thank you Jörn and Alexandre for your feedback. I'm thinking that > maybe I should just provide a hook that gets called when the plugin > detects invalid input. I could just provide a default function that > blanks the input as it is today, but would let the user decide what to > do there. > > Any ideas on how I can make my plugin more extensible are more than > welcome. > > Josh > > On Dec 22, 9:08 am, "Jörn Zaefferer" <joern.zaeffe...@googlemail.com> > wrote: >> I second that! An option to make the plugin more tolerant, especially >> in combination with other forms of validation, would be perfect. Other >> changes all sounds fine. The fix for "users typed over existing input" >> will be much appreciated. >> >> Thanks >> Jörn >> >> On Mon, Dec 22, 2008 at 3:59 PM, Alexandre Plennevaux >> >> <aplennev...@gmail.com> wrote: >> > Josh, these are very cool additions, love the New mask syntax option '?' >> > and >> > the improved usability. >> > Thanks for your hard work! >> >> > just noticed in the demo that if i don't fill the input completely and go >> > to >> > another input, it removes the entered value entirely as soon as the input >> > loses focus. That's a bit harsh. Maybe that's where a validation should >> > take >> > over and paint the input red so that the user realizes he didn't completely >> > filled in the content. >> >> > On Mon, Dec 22, 2008 at 3:39 PM, Josh Bush <josh.b...@gmail.com> wrote: >> >> >> There is now a new version of my Masked Input Plugin ( >> >>http://digitalbush.com/projects/masked-input-plugin/) for jQuery. >> >> Version 1.2.1 moves one step closer to my bigger picture for the >> >> plugin. I had to make a few breaking changes to do so, but I feel >> >> that the end result is worth it. This release adds a lot more polish >> >> to the 1.2 release. Here's what we've got. >> >> >> * BREAKING CHANGE: Removed deprecated $.mask.addPlaceholder method. >> >> Use the "$.mask.definitions['']="";" syntax instead. I said I was >> >> going to do this on the last release and now seems just as good a time >> >> as any. >> >> * BREAKING CHANGE: Removed "allowPartial" option in favor of new mask >> >> syntax I'll describe below. A discussion and code exchange with >> >> Michael Bray inspired this change. I hate that it's a breaking >> >> change, but the new way makes a lot more sense. >> >> * New mask syntax option '?'. Anything listed after '?' within the >> >> mask is considered optional user input. The common example for this >> >> is phone number + optional extension. The new syntax will look like >> >> this: "(999) 999-9999? x99999" >> >> * I got rid of the awkward input behavior where users typed over top >> >> of existing input. The plugin acted like a word processor Insert >> >> mode. This has always agrivated me, so now the input shifts on input >> >> and backspace/delete. >> >> * Now calling .change() on blur if the value has changed since the >> >> plugin prevents the change event from being fired naturally. >> >> * Pasting incomplete test no longer wipes the input. Instead, the >> >> cursor is just placed where the input leaves off. >> >> * Fixed backspace detection for iPhone. Plugin is now iPhone >> >> compatible. >> >> * Fixed pasting bug when mask starts with a literal and caret position >> >> is on the literal character. >> >> >> I feel really good about this release. I made some changes that I >> >> feel are good for the direction of the plugin. Iif you don't like >> >> some of the changes please let me know and I'll look at adding them >> >> back in as options. I'm trying hard not to bloat things up, but I >> >> don't want to remove features that are needed. >> >> >> Merry Christmas! >> >> Josh >> >> digitalbush.com