(function($){ $.fn.validationEngineLanguage = function(){ }; $.validationEngineLanguage = { newLang: function(){ $.validationEngineLanguage.allRules = { "required": { // Add your regex rules here, you can take telephone as an example "regex": "none", "alertText": "* Este campo es requerido", "alertTextCheckboxMultiple": "* Por favor selecciona una opción", "alertTextCheckboxe": "* Este checkbox es requerido" }, "minSize": { "regex": "none", "alertText": "* Mínimo ", "alertText2": " caracteres" }, "maxSize": { "regex": "none", "alertText": "* Máximo ", "alertText2": " caracteres" }, "min": { "regex": "none", "alertText": "* El valor mínimo es " }, "max": { "regex": "none", "alertText": "* El valor máximo es " }, "past": { "regex": "none", "alertText": "* Fecha anterior a " }, "future": { "regex": "none", "alertText": "* Fecha posterior a " }, "maxCheckbox": { "regex": "none", "alertText": "* Se ha excedido el número de opciones permitidas" }, "minCheckbox": { "regex": "none", "alertText": "* Por favor seleccione ", "alertText2": " opciones" }, "equals": { "regex": "none", "alertText": "* Los campos no coinciden" }, "phone": { "regex": /^[0-9a-zA-Z\.\ \'\ó\(\)]+$/, "alertText": "* Número de teléfono inválido. Sólo letras y números." }, "phonedecompras": { "regex": /^[\-\+]?\d+$/, "alertText": "* Número de teléfono inválido. Sólo números sin guiones ni espacios." }, "email": { // Simplified, was not working in the Iphone browser "regex": /^([A-Za-z0-9_\-\.\'])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,6})$/, "alertText": "* Correo inválido" }, "integer": { "regex": /^[\-\+]?\d+$/, "alertText": "* No es un valor entero válido" }, "number": { // Number, including positive, negative, and floating decimal. credit: orefalo "regex": /^[\-\+]?(([0-9]+)([\.,]([0-9]+))?|([\.,]([0-9]+))?)$/, "alertText": "* No es un valor decimal válido" }, "date": { // Date in ISO format. Credit: bassistance "regex": /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/, "alertText": "* Fecha inválida, por favor utilize el formato AAAA-MM-DD" }, "ipv4": { "regex": /^((([01]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))[.]){3}(([0-1]?[0-9]{1,2})|(2[0-4][0-9])|(25[0-5]))$/, "alertText": "* Direccion IP inválida" }, "url": { "regex": /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/, "alertText": "* URL Inválida" }, "onlyNumberSp": { "regex": /^[0-9\ ]+$/, "alertText": "* Sólo números" }, "onlyLetterSp": { "regex": /^[a-zA-Z\ \'\.\á\é\í\ó\ú\Á\É\Í\Ó\Ú\ñ\Ñ]+$/, "alertText": "* Sólo letras" }, "onlyLetter": { "regex": /^[a-zA-Z]+$/, "alertText": "* Sólo letras" }, "onlyLetterNumber": { "regex": /^[0-9a-zA-Z]+$/, "alertText": "* No se permiten caracteres especiales" }, // --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings "ajaxUserCall": { "url": "ajaxValidateFieldUser", // you may want to pass extra data on the ajax call "extraData": "name=eric", "alertTextLoad": "* Cargando, espere por favor", "alertText": "* Este nombre de usuario ya se encuentra usado" }, "ajaxNameCall": { // remote json service location "url": "ajaxValidateFieldName", // error "alertText": "* Este nombre ya se encuentra usado", // if you provide an "alertTextOk", it will show as a green prompt when the field validates "alertTextOk": "* Este nombre está disponible", // speaks by itself "alertTextLoad": "* Cargando, espere por favor" }, "descuento_manual_codigo": { "alertText": "* Captura el codigo de descuento" }, "descuento_hasta_fecha": { "alertText": "* Captura la fecha" } }; } }; $.validationEngineLanguage.newLang(); })(jQuery);