Commons Validator
  1. Commons Validator
  2. VALIDATOR-148

[validator] Client-side validation fails if not all form-fields are specified on page

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1.1 (alpha)
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: PC

      Description

      If you have form that has three fields: username, password, firstName.

      in form.jsp - you only specify username, password as fields.
      in validation.xml - you specify that username, password and firstName are all
      required fields.

      Client side/javascript validation will not "kick in" - all fields must be in the
      JSP. It'd be cool if this wasn't a requirement.

        Activity

        Hide
        David Graham added a comment -

        This doesn't make sense to me. You define 3 fields as required and then don't include those 3 fields
        on the form? Validator should not be expected to determine which fields are really required and
        which aren't.

        Show
        David Graham added a comment - This doesn't make sense to me. You define 3 fields as required and then don't include those 3 fields on the form? Validator should not be expected to determine which fields are really required and which aren't.
        Hide
        Matt Raible added a comment -

        The only reason I opened this bug is because server side validation still works
        perfectly. I think that server-side and client-side validation should work in a
        consistent fashion.

        Show
        Matt Raible added a comment - The only reason I opened this bug is because server side validation still works perfectly. I think that server-side and client-side validation should work in a consistent fashion.
        Hide
        David Graham added a comment -

        Ah, that's an important point you left out of the original request . I agree that consistency is a
        good thing so I'm reopening. I still think it's silly to require fields that aren't on the form but
        do understand how this may happen.

        Show
        David Graham added a comment - Ah, that's an important point you left out of the original request . I agree that consistency is a good thing so I'm reopening. I still think it's silly to require fields that aren't on the form but do understand how this may happen.
        Hide
        David Graham added a comment -

        Reopening...

        Show
        David Graham added a comment - Reopening...
        Hide
        Don Brown added a comment -

        Reassigning to commons-validator as the fix is in its static javascript required
        validator code...

        Show
        Don Brown added a comment - Reassigning to commons-validator as the fix is in its static javascript required validator code...
        Hide
        Don Brown added a comment -

        Fixed by modifying static required validator javascript. Thanks Matt!

        Show
        Don Brown added a comment - Fixed by modifying static required validator javascript. Thanks Matt!

          People

          • Assignee:
            Unassigned
            Reporter:
            Matt Raible
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development