Magento 2 UI Form Validation

2018-05-10 05:25:33   Magento

  Magento 2  

Magento 2 UI Form Validation

Reference Url: https://devdocs.magento.com/guides/v2.2/ui_comp_guide/components/ui-form.html

Eg:

  1. <item name="validation" xsi:type="array">
  2. <item name="validate-digits" xsi:type="boolean">true</item>
  3. </item>

Here is the list of validation which you can use in UI form

  1. min_text_length
  2. max_text_length
  3. max-words
  4. min-words
  5. range-words
  6. letters-with-basic-punc
  7. alphanumeric
  8. letters-only
  9. no-whitespace
  10. zip-range
  11. integer
  12. vinUS
  13. dateITA
  14. dateNL
  15. time
  16. time12h
  17. phoneUS
  18. phoneUK
  19. mobileUK
  20. stripped-min-length
  21. email2
  22. url2
  23. credit-card-types
  24. ipv4
  25. ipv6
  26. pattern
  27. validate-no-html-tags
  28. validate-select
  29. validate-no-empty
  30. validate-alphanum-with-spaces
  31. validate-data
  32. validate-street
  33. validate-phoneStrict
  34. validate-phoneLax
  35. validate-fax
  36. validate-email
  37. validate-emailSender
  38. validate-password
  39. validate-admin-password
  40. validate-url
  41. validate-clean-url
  42. validate-xml-identifier
  43. validate-ssn
  44. validate-zip-us
  45. validate-date-au
  46. validate-currency-dollar
  47. validate-not-negative-number
  48. validate-zero-or-greater
  49. validate-greater-than-zero
  50. validate-css-length
  51. validate-number
  52. validate-number-range
  53. validate-digits
  54. validate-digits-range
  55. validate-range
  56. validate-alpha
  57. validate-code
  58. validate-alphanum
  59. validate-date
  60. validate-identifier
  61. validate-zip-international
  62. validate-state
  63. less-than-equals-to
  64. greater-than-equals-to
  65. validate-emails
  66. validate-cc-number
  67. validate-cc-ukss
  68. required-entry
  69. checked
  70. not-negative-amount
  71. validate-per-page-value-list
  72. validate-new-password
  73. validate-item-quantity
  74. equalTo