$('#myForm').submit(function(e) { //prevent default form submitting so it can run the ajax code first e.preventDefault(); $(this).on('valid.fndtn.abide', function() { //if the form is valid then grab the values of these IDs (name, email, message) var nombre = $("input#nombre").val(); var correo = $("input#correo").val(); var telefono = $("input#telefono").val(); var mensaje = $("textarea#mensaje").val(); $("#thanks").html(""); //Data for reponse (store the values here) var dataString = 'nombre=' + nombre + '&correo=' + correo + '&telefono=' + telefono + '&mensaje=' + mensaje; //Begin Ajax call $.ajax({ type: "POST", url:"mail.php", //runs the php code data: dataString, //stores the data to be passed success: function(data){ // if success then generate the div and append the the following $('.contactform').html("
"); $("#myForm").css({ display: "none" }); $("#textPreForm").css({ display: "none" }); //$("#myForm").toggle("slow"); $('#thanks').html("
') .hide() .fadeIn(500); }, error: function(jqXHR, status, error){ //this is to check if there is any error alert("status: " + status + " message: " + error); } }); //End Ajax call //return false; }); }); $('#myForm2').submit(function(e) { //prevent default form submitting so it can run the ajax code first e.preventDefault(); $(this).on('valid.fndtn.abide', function() { //if the form is valid then grab the values of these IDs (name, email, message) var nombre = $("input#nombre").val(); var correo = $("input#correo").val(); var telefono = $("input#telefono").val(); var mensaje = $("textarea#mensaje").val(); $("#thanks").html(""); //Data for reponse (store the values here) var dataString = 'nombre=' + nombre + '&correo=' + correo + '&telefono=' + telefono + '&mensaje=' + mensaje; //Begin Ajax call $.ajax({ type: "POST", url:"mail.php", //runs the php code data: dataString, //stores the data to be passed success: function(data){ // if success then generate the div and append the the following $('.contactform').html(""); $("#myForm2").css({ display: "none" }); $("#textPreForm").css({ display: "none" }); //$("#myForm").toggle("slow"); $('#thanks').html("
') .hide() .fadeIn(500); }, error: function(jqXHR, status, error){ //this is to check if there is any error alert("status: " + status + " message: " + error); } }); //End Ajax call //return false; }); }); $('#myForm3').submit(function(e) { //prevent default form submitting so it can run the ajax code first e.preventDefault(); $(this).on('valid.fndtn.abide', function() { //if the form is valid then grab the values of these IDs (name, email, message) var nombre = $("input#nombre").val(); var correo = $("input#correo").val(); var telefono = $("input#telefono").val(); var mensaje = $("textarea#mensaje").val(); $("#thanks").html(""); //Data for reponse (store the values here) var dataString = 'nombre=' + nombre + '&correo=' + correo + '&telefono=' + telefono + '&mensaje=' + mensaje; //Begin Ajax call $.ajax({ type: "POST", url:"mail.php", //runs the php code data: dataString, //stores the data to be passed success: function(data){ // if success then generate the div and append the the following $('.contactform').html(""); $("#myForm3").css({ display: "none" }); $("#textPreForm").css({ display: "none" }); //$("#myForm").toggle("slow"); $('#thanks').html("
') .hide() .fadeIn(500); }, error: function(jqXHR, status, error){ //this is to check if there is any error alert("status: " + status + " message: " + error); } }); //End Ajax call //return false; }); }); $('#formVacante').submit(function(e) { //prevent default form submitting so it can run the ajax code first e.preventDefault(); $(this).on('valid.fndtn.abide', function() { //if the form is valid then grab the values of these IDs (name, email, message) var vacante = $("input#vacante").val(); var folio = $("input#folio").val(); var correoEmpleador = $("input#correoEmpleador").val(); var nombre = $("input#nombre").val(); var correo = $("input#correo").val(); var telefono = $("input#telefono").val(); var edad = $("input#edad").val(); var escolaridad = $("input#escolaridad").val(); var mensaje = $("textarea#mensaje").val(); $("#thanks").html(""); //Data for reponse (store the values here) var dataString = 'vacante=' + vacante + '&folio=' + folio + '&correoEmpleador=' + correoEmpleador + '&nombre=' + nombre + '&correo=' + correo + '&telefono=' + telefono + '&edad=' + edad + '&escolaridad=' + escolaridad + '&mensaje=' + mensaje; //Begin Ajax call $.ajax({ type: "POST", url:"mail.php", //runs the php code data: dataString, //stores the data to be passed success: function(data){ // if success then generate the div and append the the following $('.contactform').html(""); $("#formVacante").css({ display: "none" }); $("#textPreForm").css({ display: "none" }); //$("#myForm").toggle("slow"); $('#thanks').html("
') .hide() .fadeIn(500); }, error: function(jqXHR, status, error){ //this is to check if there is any error alert("status: " + status + " message: " + error); } }); //End Ajax call //return false; }); }); $('#formPaseoCiclista2016').submit(function(e) { //prevent default form submitting so it can run the ajax code first e.preventDefault(); $(this).on('valid.fndtn.abide', function() { //if the form is valid then grab the values of these IDs (name, email, message) var nombre = $("input#nombre").val(); var paterno = $("input#paterno").val(); var materno = $("input#materno").val(); var direccion = $("input#direccion").val(); var ciudad = $("select#ciudad").val(); var telefono = $("input#telefono").val(); var edad = $("input#edad").val(); var sexo = $("select#sexo").val(); var correo = $("input#correo").val(); var fecha = $("input#fecha").val(); $("#thanks").html(""); //Data for reponse (store the values here) var dataString = 'nombre=' + nombre + '&paterno=' + paterno + '&materno=' + materno + '&direccion=' + direccion + '&ciudad=' + ciudad + '&telefono=' + telefono + '&edad=' + edad + '&sexo=' + sexo + '&correo=' + correo + '&fecha=' + fecha; //Begin Ajax call $.ajax({ type: "POST", url:"mail.php", //runs the php code data: dataString, //stores the data to be passed success: function(data){ // if success then generate the div and append the the following $('.contactform').html(""); $("#formPaseoCiclista2016").css({ display: "none" }); $("#flyerImg").css({ display: "none" }); $("#totalParticipantes").css({ display: "none" }); $("#textPreForm").css({ display: "none" }); //$("#myForm").toggle("slow"); $('#thanks').html("
Cédula de inscripción'+ nombre +' '+ paterno +' '+ materno + ' BAJO PROTESTA DE DECIR LA VERDAD Y EN PLENO USO DE MIS FACULTADES MENTALES CERTIFICO Y MANIFIESTO QUE ESTOY CAPACITADO FÍSICA Y MENTALMENTE PARA REALIZAR ESTE RECORRIDO Y AFIRMO QUE TODOS LOS DATOS ASENTADOS EN MI CÉDULA DE INSCRIPCIÓN SON VERÍDICOS. Firma del participante Fecha de Inscripción: '+ fecha +' | Ficha del participante'+ nombre +' '+ paterno +' '+ materno +' BAJO PROTESTA DE DECIR LA VERDAD Y EN PLENO USO DE MIS FACULTADES MENTALES CERTIFICO Y MANIFIESTO QUE ESTOY CAPACITADO FÍSICA Y MENTALMENTE PARA REALIZAR ESTE RECORRIDO Y AFIRMO QUE TODOS LOS DATOS ASENTADOS EN MI CÉDULA DE INSCRIPCIÓN SON VERÍDICOS. Firma del participante Fecha de Inscripción: '+ fecha +' Fecha del evento |
') .hide() .fadeIn(500); }, error: function(jqXHR, status, error){ //this is to check if there is any error alert("status: " + status + " message: " + error); } }); //End Ajax call //return false; }); });