This is an example of an if statement on (.click)…
$('#submit').click(function () {
***********************************
var email = $('input[name=email]');
***********************************
if (email.val()=='') {
email.addClass('hightlight');
return false;
} else email.removeClass('hightlight');
...
$('#submit').click(function () {
...
var email = $('input[name=email]');
This is a PHP Ajax contact form with other data. I end up getting a lot of spam from for instance .ru (Russia), so would it be good to error out the most common ones in an if statement, or is it better to just go with a captcha. If so, any good references on a simple one visibly and use wise for this situation. The form is at
http://www.shaneofalltrades.com/index.html#contact
Open to any ideas.
i think the best way is to use a captcha service like recaptcha. Or to just implement a simple random calculation that must be answered before the post. Somthing like “What is 1+3?”