Many Web sites and applications involve forms. Form validation and error notification is part of good form's etiquette, security, and best practices. There are well-documented security issues with client-side validation via Javascript, so I have always made the trip to the server to validate in Perl. However, I've never liked the perceived latency and obvious screen refresh. Yes, I was able to provide the user with accurate error messages, but as a coder it meant keeping track of lots of things in the callbacks to do polite things like refreshing the HTML fields on the return trip (thank you HTML::FillInForm).

Enter jQuery (or Moo Tools or Prototype). Some good folks at MIT brought us these great libraries that have taken the Javascript out of the HTML coding (no more <a href="#" onclick="dosomething()">Click</a> and legitimized this powerful client-side language. Now sites can have slick new features and effects with little code and without Flash. But we can also have much nicer validation and error handling, and without the delays associated with the screen refresh.

Below I would like to show how I have learned to use jQuery, some Perl plugins, and JSON to still play it safe with server-side validation, no eval javascript, but to achieve the crisper response expected by today's Web users. I hope that it will be a help to those Web developers who are diehard Perl users, but want to try libraries like jQuery.