PageRenderTime 55ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

/public_html/javascripts/jquery.validationEngine-es.js

https://gitlab.com/zohaibsaleem/shipcliq
JavaScript | 131 lines | 119 code | 3 blank | 9 comment | 0 complexity | 039c6a7d1f7e2642de6ac4dfc1698d7b MD5 | raw file
  1. (function($){
  2. $.fn.validationEngineLanguage = function(){
  3. };
  4. $.validationEngineLanguage = {
  5. newLang: function(){
  6. $.validationEngineLanguage.allRules = {
  7. "required": { // Add your regex rules here, you can take telephone as an example
  8. "regex": "none",
  9. "alertText": "* Este campo es requerido",
  10. "alertTextCheckboxMultiple": "* Por favor selecciona una opción",
  11. "alertTextCheckboxe": "* Este checkbox está requerido"
  12. },
  13. "minSize": {
  14. "regex": "none",
  15. "alertText": "* Mínimo de ",
  16. "alertText2": " caracteres autorizados"
  17. },
  18. "groupRequired": {
  19. "regex": "none",
  20. "alertText": "* You must fill one of the following fields"
  21. },
  22. "maxSize": {
  23. "regex": "none",
  24. "alertText": "* Máximo de ",
  25. "alertText2": " caracteres autorizados"
  26. },
  27. "min": {
  28. "regex": "none",
  29. "alertText": "* Valor mínimo es "
  30. },
  31. "max": {
  32. "regex": "none",
  33. "alertText": "* Valor máximo es "
  34. },
  35. "past": {
  36. "regex": "none",
  37. "alertText": "* Fecha anterior a "
  38. },
  39. "future": {
  40. "regex": "none",
  41. "alertText": "* Fecha posterior a "
  42. },
  43. "maxCheckbox": {
  44. "regex": "none",
  45. "alertText": "* Se ha excedido el número de opciones permitidas"
  46. },
  47. "minCheckbox": {
  48. "regex": "none",
  49. "alertText": "* Por favor seleccione ",
  50. "alertText2": " opciones"
  51. },
  52. "equals": {
  53. "regex": "none",
  54. "alertText": "* Los campos no coinciden"
  55. },
  56. "creditCard": {
  57. "regex": "none",
  58. "alertText": "* No válido de tarjeta de crédito"
  59. },
  60. "phone": {
  61. // credit: jquery.h5validate.js / orefalo
  62. "regex": /^([\+][0-9]{1,3}[ \.\-])?([\(]{1}[0-9]{2,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,
  63. "alertText": "* Número de teléfono inválido"
  64. },
  65. "email": {
  66. // Shamelessly lifted from Scott Gonzalez via the Bassistance Validation plugin http://projects.scottsplayground.com/email_address_validation/
  67. "regex": /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([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])))\.?$/i,
  68. "alertText": "* Correo inválido"
  69. },
  70. "integer": {
  71. "regex": /^[\-\+]?\d+$/,
  72. "alertText": "* No es un valor entero válido"
  73. },
  74. "number": {
  75. // Number, including positive, negative, and floating decimal. credit: orefalo
  76. "regex": /^[\-\+]?(([0-9]+)([\.,]([0-9]+))?|([\.,]([0-9]+))?)$/,
  77. "alertText": "* No es un valor decimal válido"
  78. },
  79. "date": {
  80. "regex": /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/,
  81. "alertText": "* Fecha inválida, por favor utilize el formato AAAA-MM-DD"
  82. },
  83. "ipv4": {
  84. "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]))$/,
  85. "alertText": "* Direccion IP inválida"
  86. },
  87. "url": {
  88. "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})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,
  89. "alertText": "* URL Inválida"
  90. },
  91. "onlyNumberSp": {
  92. "regex": /^[0-9\ ]+$/,
  93. "alertText": "* Sólo números"
  94. },
  95. "onlyLetterSp": {
  96. "regex": /^[a-zA-Z\ \']+$/,
  97. "alertText": "* Sólo letras"
  98. },
  99. "onlyLetterNumber": {
  100. "regex": /^[0-9a-zA-Z]+$/,
  101. "alertText": "* No se permiten caracteres especiales"
  102. },
  103. // --- CUSTOM RULES -- Those are specific to the demos, they can be removed or changed to your likings
  104. "ajaxUserCall": {
  105. "url": "ajaxValidateFieldUser",
  106. // you may want to pass extra data on the ajax call
  107. "extraData": "name=eric",
  108. "alertTextLoad": "* Cargando, espere por favor",
  109. "alertText": "* Este nombre de usuario ya se encuentra usado"
  110. },
  111. "ajaxNameCall": {
  112. // remote json service location
  113. "url": "ajaxValidateFieldName",
  114. // error
  115. "alertText": "* Este nombre ya se encuentra usado",
  116. // if you provide an "alertTextOk", it will show as a green prompt when the field validates
  117. "alertTextOk": "* Este nombre está disponible",
  118. // speaks by itself
  119. "alertTextLoad": "* Cargando, espere por favor"
  120. },
  121. "validate2fields": {
  122. "alertText": "* Por favor entrar HELLO"
  123. }
  124. };
  125. }
  126. };
  127. $.validationEngineLanguage.newLang();
  128. })(jQuery);