I am kind of a newbie in all this PHP stuff, but I know the basics. I need a little help (should be very easy for someone who knows PHP well).
I want to add captcha to my submission form, but not sure where to add validation code.
Here is the submission form code:
[code]
<?php echo SEND_INQUIRY;?>
As I understand I should open that “inquiry_validation.js” and edit it?
I want to add this captcha as found here - https://developers.google.com/recaptcha/docs/php?hl=de
I know it is a simple work, but since I am a newbie in all this, I have some difficulties with it. Would be really nice if someone could help me with it.
All I need is a confirmation that I should edit that file I’ve mentioned above and what code I should add there. I have two API keys already, So I’ll do that replacement by myself, I just would like to get codes that I need to add to my current form and that .js file.
Here’s the code inside that .js file:
$(document).ready(function(){function u(){if($("#agt_mail_name").val()==""){t.addClass("error");n.text("Please Enter Your Name");n.addClass("message_error2");return false}else{t.removeClass("error");n.text("");n.removeClass("message_error2");return true}}function a(){var e=0;if($("#agt_mail_email").val()==""){e=1}else if($("#agt_mail_email").val()!=""){var t=$("#agt_mail_email").val();var n=/^[a-zA-Z0-9]+[a-zA-Z0-9_.-]+[a-zA-Z0-9_-]+@[a-zA-Z0-9]+[a-zA-Z0-9.-]+[a-zA-Z0-9]+.[a-z]{2,4}$/;if(n.test(t)){e=0}else{e=1}}if(e){r.addClass("error");i.text("Please Enter valid Email Address");i.addClass("message_error2");return false}else{r.removeClass("error");i.text("");i.removeClass("message_error");return true}}function f(){if($("#agt_mail_msg").val()==""){s.addClass("error");o.text("Please Enter Comments");o.addClass("message_error2");return false}else{s.removeClass("error");o.text("");o.removeClass("message_error2");return true}}function l(){document.getElementById("agt_mail_name").value="";document.getElementById("agt_mail_email").value="";document.getElementById("agt_mail_phone").value="";document.getElementById("agt_mail_msg").value=""}var e=$("#agt_mail_agent");var t=$("#agt_mail_name");var n=$("#span_agt_mail_name");var r=$("#agt_mail_email");var i=$("#span_agt_mail_email");var s=$("#agt_mail_msg");var o=$("#span_agt_mail_msg");t.blur(u);r.blur(a);s.blur(f);t.keyup(u);r.keyup(a);s.keyup(f);e.submit(function(){if(u()&a()&f()){return true}else{return false}})})