Uploaded image for project: 'Commons Validator'
  1. Commons Validator
  2. VALIDATOR-73

[validator] validateRequired.js uses unsupported DOM method for validation.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.2.0 Release
    • None
    • None
    • Operating System: All
      Platform: All

    • 31534

    Description

      validateRequired() method relies on the DOM method document.getAttributeNode()
      for retrieving a form's "name" attribute value. document.getAttributeNode() is
      not supported by Internet Explorer 5.5 or earlier and breaks the validation
      routine. Patch uses better supported document.getAttribute().

      Note: While this patch is for validateRequired.js only,
      document.getAttributeNode() is also present in:
      ./jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateFloatRange.js
      ./jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateShort.js
      ./jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateMinLength.js
      ./jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateDate.js
      ./jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateEmail.js
      ./jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateByte.js
      ./jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateIntRange.js
      ./jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateMask.js
      ./jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateCreditCard.js
      ./jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateInteger.js
      ./jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateMaxLength.js
      ./jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateFloat.js

      Index:
      ./jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateRequired.js
      ===================================================================
      RCS file:
      /home/cvspublic/jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateRequired.js,v
      retrieving revision 1.13
      diff -u -r1.13 validateRequired.js

      ./jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateRequired.js
      28 Mar 2004 16:53:21 -0000 1.13
      +++
      ./jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateRequired.js
      4 Oct 2004 22:00:58 -0000
      @@ -12,9 +12,9 @@
      var focusField = null;
      var i = 0;
      var fields = new Array();

      • var formName = form.getAttributeNode("name");
        + var formName = form.getAttribute("name");
      • oRequired = eval('new ' + formName.value + '_required()');
        + oRequired = eval('new ' + formName + '_required()');

      for (x in oRequired) {
      var field = form[oRequired[x][0]];

      Attachments

        Activity

          People

            Unassigned Unassigned
            dseleno@ebuilt.com Dave Seleno
            Votes:
            4 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: