when it comes to form validation i get frustrated too quickly to sit there and reinvent the wheel every time. my solution has been made more simple than i would have asked: TMT Validation Library from www.massimocorner.com
so easy to install.
link to libs
add call into form
define types of validation on inputs.
i would reccomend this to a friend