Created
November 24, 2015 17:54
-
-
Save pablocattaneo/8ba0c6ae7afa55190d65 to your computer and use it in GitHub Desktop.
Validation forms with prototype: list validation css class: http://inchoo.net/magento/out-of-the-box-form-validation-in-magento/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="" id="formualrioMonroe" novalidate> | |
<input type="tel" name="dni" placeholder="Ingresá tu DNI" id="dni" class="required-entry validate-number"/> <!-- para validar un determinado campo se agrega un clase css ya predefinida en el validador por ejemplo required-entry make de field mandatory --> | |
<input type="email" name="email" placeholder="Ingresá tu correo" id="email" class="required-entry validate-email"/> | |
<input type="submit" value="Obtener Cupón" class="button"> | |
</form> | |
<!-- scrip para validar el formulario --> | |
<script type="text/javascript"> | |
//< ![CDATA[ | |
var customForm = new VarienForm('formualrioMonroe'); // ID del formulario a validar | |
//]]> | |
</script> | |
http://inchoo.net/magento/out-of-the-box-form-validation-in-magento/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment