Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save johanmendezb/b2c90f996aca693aadfa175e4703c814 to your computer and use it in GitHub Desktop.
Save johanmendezb/b2c90f996aca693aadfa175e4703c814 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
(function(e){function t(){var t=window.module.lp.form.data;var n=t.validationMessages;var r=t.validationRules;this.changeTitle=function(n){e(function(){e("#"+t.errorContainerId).find("div.error").text(n)})};this.changeField=function(e,t,i){if(!n[e])return;n[e].required=t;if(i&&r[e].email)n[e].email=i;if(i&&r[e].phone)n[e].phone=i}}window.errors=new t(lp.jQuery)})(lp.jQuery)
// Change the title bar of the validation error box
errors.changeTitle("Por favor soluciona estos problemas:");
// Change the error text for specific fields. The first message is shown when nothing is
// entered and the second is shown when an invalid email/phone number is entered.
errors.changeField("nombre_y_apellido", "¡Ingresa tu nombre!");
errors.changeField("correo_electronico", "¡Ingresa tu correo electrónico!", "¡El correo ingresado no es un correo valido!");
errors.changeField("telefono", "¡Ingresa tu teléfono!", "¡El número ingresado no es un número de teléfono valido!");
errors.changeField("politica_de_tratamiento", "¡Lee las políticas de tratamiento de datos personales y aceptalos!");
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment