CONTÁCTENOS
Nuestras oficinas.
Área de Psicobiología
Departamento de Psicología
Universidad de A Coruña
Campus de Elviña s/n
15071 A Coruña
Teléfono: +34 981 16 70 00 Ext. 1783
Área de Psicobiología
Departamento de Psicología
Universidad de A Coruña
Campus de Elviña s/n
15071 A Coruña
Teléfono: +34 981 16 70 00 Ext. 1783
jQuery(document).ready(function($){
$j('form#contact-form').submit(function(){
$j('form#contact-form .contact-error').remove();
var hasError = false;
$j('form#contact-form .requiredField').each(function() {
if(jQuery.trim($j(this).val()) == ''){
var labelText = $j(this).prev('label').text();
$j(this).parent().append(' Required');
$j(this).addClass('inputError');
hasError = true;
} else { //else 1
if($j(this).hasClass('email')) { //if hasClass('email')
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
if(!emailReg.test(jQuery.trim($j(this).val()))){
var labelText = $j(this).prev('label').text();
$j(this).parent().append(' Invalid');
$j(this).addClass('inputError');
hasError = true;
}
} //end of if hasClass('email')
} // end of else 1
}); //end of each()
if(!hasError){
challengeField = $j("input#recaptcha_challenge_field").val();
responseField = $j("input#recaptcha_response_field").val();
name = $j("input#fname").val();
lastname = $j("input#lname").val();
email = $j("input#email").val();
website = $j("input#website").val();
message = $j("textarea#message").val();
var form_post_data = "";
var html = $j.ajax({
type: "POST",
url: "https://dicomosa.org/wp-content/themes/subway/includes/ajax_mail.php",
data: "recaptcha_challenge_field=" + challengeField + "&recaptcha_response_field=" + responseField + "&name=" + name + "&lastname=" + lastname + "&email=" + email + "&website=" + website + "&message=" + message,
async: false
}).responseText;
if(html == "success"){
var formInput = $j(this).serialize();
$j("form#contact-form").before('
Your email was successfully sent. We will contact you as soon as possible.
');
$j("form#contact-form").hide();
$j.post($j(this).attr('action'),formInput);
hasError = false;
return false;
} else {
$j("form#contact-form").before('
');
return false;
}
}
return false;
});
});