Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-594

constraints in client not evaluated exactly the same way as on server

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Normal Normal
    • 5.0.10
    • 5.0.9
    • Components, General
    • None

      In the demo for forms, go to the email field and enter this: "This @ should . also && work [email protected]" You'll find that this doesn't cause a constraint violation because the value does, in fact, contain a valid email. This is because client side uses JavaScript's String's match() method which is more like Matcher's find() method. However, I doubt that's the intent of the constraint.

      When the same constraint is validated server-side, it works as expected because server-side validation uses Matcher's matches() method which matches against the entire string. This seems rather confusing to me. Whether this is intentional behavior or not, it seems like the documentation could be updated to make things more clear. I don't believe I've seen anything in the documentation that even hints at this difference between client-side vs server-side validation. Am I missing something?

            benbai benbai
            mogren mogren
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: