Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.