commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 31534] New: - validateRequired.js uses unsupported DOM method for validation.
Date Mon, 04 Oct 2004 22:19:06 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31534>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31534

validateRequired.js uses unsupported DOM method for validation.

           Summary: validateRequired.js uses unsupported DOM method for
                    validation.
           Product: Commons
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Validator
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: dseleno@ebuilt.com


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]];

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message