Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm new to form validation and I have been lucky over the years. I would like to update my method of form creation in my sites. I was curious to know what is standard and if there is a preexisting solution to my needs? My goal this week is to learn how to validate an email address and check for spam.

I can create forms in HTML5 without issues but I don't know if JavaScript form validation with PHP form validation is standard. I did run across this from my searches and appears to be a good start, but I want to know more.

share|improve this question
up vote 2 down vote accepted

Wow, that's a pretty old article. HTML5 has built-in form validation, but fails in browsers with no HTML5 support.

Of course there are javascript libraries which helps you with the validation part like:

Parsley.js (Javascript) or
jQuery Validation Engine (Javascript) or
Validation (PHP)

I suggest you take a look on the different implementation methods and what you can do with them.

For Spam checking, well, that's another story. There aren't very good standalone libraries which are any good (at least not in my experience). Of course, you could always go with integrating the pretty awesome Akismet to detect spam after form submission.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.