struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dgra...@apache.org
Subject cvs commit: jakarta-struts/conf/share validator-rules.xml
Date Tue, 04 Mar 2003 03:52:06 GMT
dgraham     2003/03/03 19:52:06

  Modified:    conf/share validator-rules.xml
  Log:
  Fixed PR#17622.
  
  Revision  Changes    Path
  1.26      +52 -21    jakarta-struts/conf/share/validator-rules.xml
  
  Index: validator-rules.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/conf/share/validator-rules.xml,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- validator-rules.xml	15 Feb 2003 12:40:25 -0000	1.25
  +++ validator-rules.xml	4 Mar 2003 03:52:06 -0000	1.26
  @@ -287,15 +287,24 @@
   						}
                           
                           if (value.length > 0) {
  +                            if (!isAllDigits(value)) {
  +                                bValid = false;
  +                                if (i == 0) {
  +                                    focusField = field;
  +                                }
  +                                fields[i++] = oByte[x][1];
   
  -	                        var iValue = parseInt(value);
  -	                        if (isNaN(iValue) || !(iValue >= -128 && iValue <=
127)) {
  -	                            if (i == 0) {
  -	                                focusField = field;
  +                            } else {
  +
  +	                            var iValue = parseInt(value);
  +	                            if (isNaN(iValue) || !(iValue >= -128 && iValue
<= 127)) {
  +	                                if (i == 0) {
  +	                                    focusField = field;
  +	                                }
  +	                                fields[i++] = oByte[x][1];
  +	                                bValid = false;
   	                            }
  -	                            fields[i++] = oByte[x][1];
  -	                            bValid = false;
  -	                        }
  +                            }
   						}
   						
                       }
  @@ -350,14 +359,23 @@
   						}
                           
                           if (value.length > 0) {
  +                            if (!isAllDigits(value)) {
  +                                bValid = false;
  +                                if (i == 0) {
  +                                    focusField = field;
  +                                }
  +                                fields[i++] = oShort[x][1];
  +
  +                            } else {
                           
  -	                        var iValue = parseInt(value);
  -	                        if (isNaN(iValue) || !(iValue >= -32768 && iValue <=
32767)) {
  -	                            if (i == 0) {
  -	                                focusField = field;
  +	                            var iValue = parseInt(value);
  +	                            if (isNaN(iValue) || !(iValue >= -32768 && iValue
<= 32767)) {
  +	                                if (i == 0) {
  +	                                    focusField = field;
  +	                                }
  +	                                fields[i++] = oShort[x][1];
  +	                                bValid = false;
   	                            }
  -	                            fields[i++] = oShort[x][1];
  -	                            bValid = false;
   	                       }
                          }
                       }
  @@ -415,6 +433,11 @@
                           
                               if (!isAllDigits(value)) {
                                   bValid = false;
  +                                if (i == 0) {
  +	                                focusField = field;
  +	                            }
  +						        fields[i++] = oInteger[x][1];
  +						        
                               } else {
   	                            var iValue = parseInt(value);
   	                            if (isNaN(iValue) || !(iValue >= -2147483648 &&
iValue <= 2147483647)) {
  @@ -507,15 +530,23 @@
   						}
                           
                           if (value.length > 0) {
  -                        
  -	                        var iValue = parseFloat(value);
  -	                        if (isNaN(iValue)) {
  -	                            if (i == 0) {
  -	                                focusField = field;
  +                            if (!isAllDigits(value)) {
  +                                bValid = false;
  +                                if (i == 0) {
  +                                    focusField = field;
  +                                }
  +                                fields[i++] = oFloat[x][1];
  +
  +                            } else {
  +	                            var iValue = parseFloat(value);
  +	                            if (isNaN(iValue)) {
  +	                                if (i == 0) {
  +	                                    focusField = field;
  +	                                }
  +	                                fields[i++] = oFloat[x][1];
  +	                                bValid = false;
   	                            }
  -	                            fields[i++] = oFloat[x][1];
  -	                            bValid = false;
  -	                        }
  +                            }
                           }
                       }
                   }
  
  
  

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


Mime
View raw message