I am trying to do client-side validation using AJAX to check for empty fields on a simple form. If the field is empty, I want to notify the user that this is not valid. The form should not submit if there are any empty fields.
What’s the best way to do this?
Ajax is not required to do client-side validation. I can only assumed you’re interchanging the term with “jQuery”. In that case…
jQuery Validate is, by far, the mostly widely used jQuery validation plugin.
Here is a working demo…
http://jsfiddle.net/EggSb/
jQuery:
HTML: