You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2003/02/13 21:35:27 UTC

DO NOT REPLY [Bug 17056] New: - Javascript error in validator-rules.xml

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17056>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=17056

Javascript error in validator-rules.xml

           Summary: Javascript error in validator-rules.xml
           Product: Struts
           Version: Nightly Build
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Validator Framework
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: franco.caponi@tin.it


There is a javascript error in the isAllDigits() javascript function used 
validating integer fields: it declare validchars variabile and the try to use 
validChars variable.

This is the code:


function isAllDigits(argvalue) {
                argvalue = argvalue.toString();
                var validchars = "0123456789"; <---- variable declaration
                var startFrom = 0;
                if (argvalue.substring(0, 2) == "0x") {
                   validchars = "0123456789abcdefABCDEF";
                   startFrom = 2;
                } else if (argvalue.charAt(0) == "0") {
                   validchars = "01234567";
                   startFrom = 1;
                }
                for (var n = 0; n < argvalue.length; n++) {
                    <----- undefined variable
                    if (validChars.indexOf(argvalue.substring(n, n+1)) == -1) 
return false;
                }
                return true;
            }

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