1 2$(document).ready(function () { 3 4 $( "#btn-enviar" ).click(function( event ) { 5 event.preventDefault(); 6 var captchResponse = $('#g-recaptcha-response').val(); 7 if (captchResponse.length == 0) { 8 $( "#g-recaptcha-error" ).show(); 9 } else { 10 $( "#g-recaptcha-error" ).hide(); 11 $( "#contacto_form" ).submit(); 12 } 13 }); 14 15 16 if(window.location.href.includes(".com/en")){ 17 validarFormularioEn(); 18 }else{ 19 validarFormulario(); 20 } 21 22}); 23function validarFormulario(){ 24 $("#contacto_form").validate({ 25 rules: { 26 Nombre: {required: true,minlength: 3,maxlength: 50}, 27 Email: {required: true, email: true,maxlength: 50}, 28 Asunto: {required: true,minlength: 5,maxlength: 255}, 29 Mensaje: {required: true,minlength: 10}, 30 privacidad: "required"}, 31 messages: { 32 Nombre: { 33 required: "Por favor introduce tu nombre", 34 minlength: "Tu nombre tiene que tener al menos 3 caracteres", 35 maxlength: "Has superado el maximo numero de caracteres" 36 }, 37 Mensaje: { 38 required: "Por favor introduce un mensaje", 39 minlength: "El mensaje tiene que tener al menos 10 caracteres" 40 }, 41 Email: { 42 required: "Por favor introduce un email.", 43 email: "Por favor introduce un email válido", 44 maxlength: "Has superado el maximo numero de caracteres" 45 }, 46 privacidad: "Debe aceptar nuestra polÃtica de privacidad" 47 } 48 }); 49} 50function validarFormularioEn(){ 51 $("#contacto_form").validate({ 52 rules: { 53 Nombre: {required: true,minlength: 3,maxlength: 50}, 54 Email: {required: true, email: true,maxlength: 50}, 55 Mensaje: {required: true,minlength: 10}, 56 privacidad: "required"}, 57 messages: { 58 Nombre: { 59 required: "Please enter your name", 60 minlength: "Your name must have at least 3 characters", 61 maxlength: "You have exceeded the maximum number of characters" 62 }, 63 Mensaje: { 64 required: "Please enter a message", 65 minlength: "The message must have at least 10 characters" 66 }, 67 Email: { 68 required: "Please enter an email.", 69 email: "Please enter a valid email", 70 maxlength: "You have exceeded the maximum number of characters" 71 }, 72 privacidad: "You must accept our privacy policy" 73 } 74 }); 75}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.