Add contact recaptcha form validation

This commit is contained in:
German Correa 2017-09-07 14:15:31 -03:00
parent 33764e2006
commit 45b34dc24f

View File

@ -96,9 +96,19 @@ $(document).ready(function(){
$("#detallefinan textarea").keyup(validateTextarea);
$('#contactform').submit(function(event){
var fail=false;
$("#statusmsg").hide();
event.preventDefault();
if($('#g-recaptcha-response').val() == ""){
$("div.g-recaptcha").tooltip({
"title":'Marque "No soy un robot"',
"pacement":"right",
"trigger":"manual"
});
$("div.g-recaptcha").tooltip("show");
fail=true;
}
if(!fail){
var post = $.post('contact', $(this).serialize());
post.done(function(data){
data = $.parseJSON(data);
@ -115,6 +125,7 @@ $(document).ready(function(){
post.fail(function(error){
console.log(error)
});
}
});
$("#detallefinan").hide();
$("#detallefinan textarea").val("");