commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dgra...@apache.org
Subject cvs commit: jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript validateRequired.js
Date Wed, 25 Jun 2003 01:14:22 GMT
dgraham     2003/06/24 18:14:22

  Modified:    validator/src/javascript/org/apache/commons/validator/javascript
                        validateRequired.js
  Log:
  Copy changes from Struts for PR# 21051.
  
  Revision  Changes    Path
  1.2       +6 -1      jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateRequired.js
  
  Index: validateRequired.js
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/validator/src/javascript/org/apache/commons/validator/javascript/validateRequired.js,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- validateRequired.js	18 May 2003 21:36:06 -0000	1.1
  +++ validateRequired.js	25 Jun 2003 01:14:22 -0000	1.2
  @@ -26,7 +26,7 @@
                       value = field.value;
                   }
   
  -                if (value == '') {
  +                if (trim(value).length == 0) {
   
                       if (i == 0) {
                           focusField = field;
  @@ -41,4 +41,9 @@
              alert(fields.join('\n'));
           }
           return isValid;
  +    }
  +    
  +    // Trim whitespace from left and right sides of s.
  +    function trim(s) {
  +        return s.replace( /^\s*/, "" ).replace( /\s*$/, "" );
       }
  
  
  

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