Contact form not vaildating fields
The theme provided contact form is not validating the name and email fields. If I left them empty and write something in the comment field and hit the submit button, the forms allows it.
I would also like to add a captcha to avoid spam. What do you recommend?
You might want to try a more robust plugin like Contact Form 7 for something like this. The contact form that comes with the theme is a page template and isn’t very robust at all.
Come on Casey Thats what I pay for???
Sorry, I sped through this thinking you were asking about captcha. I’ve updated the contact form page template, so you should be able to validate all fields now. You can re-download the theme or just grab contact-form.php from here: http://pastebin.com/raw.php?i=zimrzYFd
As for adding your own captcha, there is a built in “honeypot” captcha which is basically a bot trap hidden form field. If the field is filled out, the form does not submit. If you want to implement more advanced captcha, you might try recaptcha or adding a simple math problem to the form.
Excellent!!!! now we are talking!!! I will update the contact-form.php and let you know the results.
Fyi, it might be best to update from the theme download. I’ve added some additional functionality since this post.
Great !!! I will do it!!! I fast updated the php and now the validation is working but I dont see the honeypot captcha to be working. Any idea?
I will look forward the recaptcha you mention.
You won’t see the captcha. It’s a bot trap..not a human trap
All fields are validating now but When I click the send button Where it is sending the email? I dont see where to put the mailto in the theme options.
It should be sending to the contact email defined in theme options.
Please, Could you be more specific, because in the contact form I only have the From email and From Mail, both of them referring to the “copy of their email” check mark
The from email is the email where you should receive the form submissions. If this is not set, it should default to the site admin.
The e-mail information in the from field is correct, but when I hit the submit button I dont receive any email, then I installed the WP-Mail-SMTP, configure it and the test from this plug-in was successfull these means that the hosting relay is working. Tried again after the plug-in test but nothing was received.
Any log that I can look at?
The form uses basic PHP mail. Your hosting control panel should have a PHP error log if there are any errors.
I assume you’ve checked your spam folders?
I checked the spam and nothing found. I just activated the error logs under GoDaddy error logs