commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nia...@apache.org
Subject svn commit: r376673 - /jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/
Date Fri, 10 Feb 2006 13:42:32 GMT
Author: niallp
Date: Fri Feb 10 05:42:31 2006
New Revision: 376673

URL: http://svn.apache.org/viewcvs?rev=376673&view=rev
Log:
Bug 38581 - Cater for field.disabled being undefined (issue in Netscape 4.7) - reported by
Yugandhar

Modified:
    jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateByte.js
    jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateCreditCard.js
    jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateDate.js
    jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateEmail.js
    jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloat.js
    jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloatRange.js
    jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateIntRange.js
    jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateInteger.js
    jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMask.js
    jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMaxLength.js
    jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMinLength.js
    jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateRequired.js
    jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateShort.js
    jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateUtilities.js

Modified: jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateByte.js
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateByte.js?rev=376673&r1=376672&r2=376673&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateByte.js
(original)
+++ jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateByte.js
Fri Feb 10 05:42:31 2006
@@ -27,8 +27,7 @@
                 field.type == 'text' ||
                 field.type == 'textarea' ||
                 field.type == 'select-one' ||
-                field.type == 'radio')  &&
-                field.disabled == false) {
+                field.type == 'radio')) {
 
                 var value = '';
                 // get field's value

Modified: jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateCreditCard.js
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateCreditCard.js?rev=376673&r1=376672&r2=376673&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateCreditCard.js
(original)
+++ jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateCreditCard.js
Fri Feb 10 05:42:31 2006
@@ -24,8 +24,7 @@
             }
             if ((field.type == 'text' ||
                  field.type == 'textarea') &&
-                (field.value.length > 0)  &&
-                 field.disabled == false) {
+                (field.value.length > 0)) {
                 if (!jcv_luhnCheck(field.value)) {
                     if (i == 0) {
                         focusField = field;

Modified: jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateDate.js
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateDate.js?rev=376673&r1=376672&r2=376673&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateDate.js
(original)
+++ jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateDate.js
Fri Feb 10 05:42:31 2006
@@ -33,8 +33,7 @@
            if ((field.type == 'hidden' ||
                 field.type == 'text' ||
                 field.type == 'textarea') &&
-               (value.length > 0) && (datePattern.length > 0) &&
-                field.disabled == false) {
+               (value.length > 0) && (datePattern.length > 0)) {
                  var MONTH = "MM";
                  var DAY = "dd";
                  var YEAR = "yyyy";

Modified: jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateEmail.js
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateEmail.js?rev=376673&r1=376672&r2=376673&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateEmail.js
(original)
+++ jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateEmail.js
Fri Feb 10 05:42:31 2006
@@ -25,8 +25,7 @@
             if ((field.type == 'hidden' || 
                  field.type == 'text' ||
                  field.type == 'textarea') &&
-                (field.value.length > 0) &&
-                field.disabled == false) {
+                (field.value.length > 0)) {
                 if (!jcv_checkEmail(field.value)) {
                     if (i == 0) {
                         focusField = field;

Modified: jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloat.js
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloat.js?rev=376673&r1=376672&r2=376673&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloat.js
(original)
+++ jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloat.js
Fri Feb 10 05:42:31 2006
@@ -26,8 +26,7 @@
                 field.type == 'text' ||
                 field.type == 'textarea' ||
                 field.type == 'select-one' ||
-                field.type == 'radio') &&
-                field.disabled == false) {
+                field.type == 'radio')) {
         
             	var value = '';
                 // get field's value

Modified: jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloatRange.js
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloatRange.js?rev=376673&r1=376672&r2=376673&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloatRange.js
(original)
+++ jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateFloatRange.js
Fri Feb 10 05:42:31 2006
@@ -24,8 +24,7 @@
             
             if ((field.type == 'hidden' ||
                 field.type == 'text' || field.type == 'textarea') &&
-                (field.value.length > 0)  &&
-                 field.disabled == false) {
+                (field.value.length > 0)) {
         
                 var fMin = parseFloat(oRange[x][2]("min"));
                 var fMax = parseFloat(oRange[x][2]("max"));

Modified: jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateIntRange.js
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateIntRange.js?rev=376673&r1=376672&r2=376673&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateIntRange.js
(original)
+++ jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateIntRange.js
Fri Feb 10 05:42:31 2006
@@ -18,10 +18,7 @@
                 continue;
             }
             var field = form[oRange[x][0]];
-            if (!jcv_isFieldPresent(field)) {
-              continue;
-            }
-            if (field.disabled == false)  {
+            if (jcv_isFieldPresent(field)) {
                 var value = '';
                 if (field.type == 'hidden' ||
                     field.type == 'text' || field.type == 'textarea' ||

Modified: jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateInteger.js
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateInteger.js?rev=376673&r1=376672&r2=376673&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateInteger.js
(original)
+++ jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateInteger.js
Fri Feb 10 05:42:31 2006
@@ -26,8 +26,7 @@
                 field.type == 'text' ||
                 field.type == 'textarea' ||
                 field.type == 'select-one' ||
-                field.type == 'radio') &&
-                field.disabled == false) {
+                field.type == 'radio')) {
 
                 var value = '';
                 // get field's value

Modified: jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMask.js
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMask.js?rev=376673&r1=376672&r2=376673&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMask.js
(original)
+++ jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMask.js
Fri Feb 10 05:42:31 2006
@@ -26,8 +26,7 @@
                 field.type == 'text' ||
                  field.type == 'textarea' ||
 				 field.type == 'file') &&
-                 (field.value.length > 0) &&
-                 field.disabled == false) {
+                 (field.value.length > 0)) {
 
                 if (!jcv_matchPattern(field.value, oMasked[x][2]("mask"))) {
                     if (i == 0) {

Modified: jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMaxLength.js
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMaxLength.js?rev=376673&r1=376672&r2=376673&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMaxLength.js
(original)
+++ jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMaxLength.js
Fri Feb 10 05:42:31 2006
@@ -28,8 +28,7 @@
             if ((field.type == 'hidden' ||
                 field.type == 'text' ||
                 field.type == 'password' ||
-                field.type == 'textarea') &&
-                field.disabled == false) {
+                field.type == 'textarea')) {
 
                 /* Adjust length for carriage returns - see Bug 37962 */
                 var lineEndLength = oMaxLength[x][2]("lineEndLength");

Modified: jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMinLength.js
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMinLength.js?rev=376673&r1=376672&r2=376673&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMinLength.js
(original)
+++ jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateMinLength.js
Fri Feb 10 05:42:31 2006
@@ -29,8 +29,7 @@
             if ((field.type == 'hidden' ||
                 field.type == 'text' ||
                 field.type == 'password' ||
-                field.type == 'textarea') &&
-                field.disabled == false) {
+                field.type == 'textarea')) {
 
                 /* Adjust length for carriage returns - see Bug 37962 */
                 var lineEndLength = oMinLength[x][2]("lineEndLength");

Modified: jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateRequired.js
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateRequired.js?rev=376673&r1=376672&r2=376673&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateRequired.js
(original)
+++ jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateRequired.js
Fri Feb 10 05:42:31 2006
@@ -31,8 +31,7 @@
                 field.type == 'radio' ||
                 field.type == 'checkbox' ||
                 field.type == 'select-one' ||
-                field.type == 'password') &&
-                field.disabled == false) {
+                field.type == 'password')) {
 
                 var value = '';
                 // get field's value

Modified: jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateShort.js
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateShort.js?rev=376673&r1=376672&r2=376673&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateShort.js
(original)
+++ jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateShort.js
Fri Feb 10 05:42:31 2006
@@ -27,8 +27,7 @@
                 field.type == 'text' ||
                 field.type == 'textarea' ||
                 field.type == 'select-one' ||
-                field.type == 'radio')  &&
-                field.disabled == false) {
+                field.type == 'radio')) {
 
                 var value = '';
                 // get field's value

Modified: jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateUtilities.js
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateUtilities.js?rev=376673&r1=376672&r2=376673&view=diff
==============================================================================
--- jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateUtilities.js
(original)
+++ jakarta/commons/proper/validator/trunk/src/javascript/org/apache/commons/validator/javascript/validateUtilities.js
Fri Feb 10 05:42:31 2006
@@ -86,7 +86,15 @@
    * @param field The form field.
    */
   function jcv_isFieldPresent(field) {
-      return !(field == null || field == undefined);
+      var fieldPresent = true;
+      if (field == null || field == undefined) {
+          fieldPresent = false;
+      } else {
+          if (field.disabled) {
+              fieldPresent = false;
+          }
+      }
+      return fieldPresent;
   }
 
   /**



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