Live (on-Blur) Validation
I'm really starting to like the idea of three stage validation, validating on blur where possible, on submit where supported and then of course on the server as a backstop for users without Javascript and/or with malicious intent. There is a framework designed to make it easy to create on-blur validations and while it isn't exactly how I want to work, I think it's close enough that my first jQuery plug-in may well be based on this concept, although with support for a validation to be described once and then run both on blur and on submit.
Thoughts?



http://labs.adobe.com/technologies/spry/
It would be nice to see this all the way through the form being submitted and returned back to the client.
For instance, you may be entering information from paper into a web system and you want to fill in the information you have and then go back and enter the missing info. If you are tabing through the fields blur validation will get old really quick.
I guess it depends on your users and the use of the app.
What I don't like is forms that won't let you tab out of the field until it is filled out correctly, or that pop-up a dialog onBlur, or whatever. In other words, let onBlur validation give the user some cues that they may have missed something, but ultimately let the user fill out the form their way, and save the heavy validation for server-side, possibly combined with onSubmit.
@Peter, This is a huge and quickly changing topic. In the past I've used some onBlur validation to provide the kind of cues described here, but haven't ever bothered with client-side onSubmit validation; I've generally felt that the benefits don't outweigh the cost of having to maintain two versions of each validation rule.
Two big things are changing: The first is just that an answer to that problem is starting to emerge, in the form of validation frameworks that let you write a single validation rule and have it applied both client-side and server-side. I haven't found one I love yet, but it's only a matter of time.
The bigger change, though, is that for many forms, there's no longer a formal "submit" process. If the form in question is now part of an Ajax-based application, hitting the "submit" button doesn't necessarily do a traditional http post and page refresh; it may instead invoke an Ajax method that returns new data to be displayed within the same page. If this is the case, then server-side validation (which obviously is still necessary) doesn't have the capabilities it had in the past-- it can't display a UI which shows validation errors. The client-side has to be responsible for all of that. This tilts the analysis in the direction of validating the whole form before doing the Ajax post.
Great comments - thanks. I also tend to agree that there is value in on blur as long as it is supporting but not obtrusive, I'm also playing with a way to gen the onblur, onsubmit and server side validations from a single XML description, and I think you make a good point about the move towards AJAX apps where you may not always HAVE a normal page reload submit (although you're still going to want to be able to validate on the server side and throw back any errors as an additional level of security/validation, so I'm not sure it'll change the game too much).