You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2002/03/21 13:32:23 UTC

DO NOT REPLY [Bug 7318] New: - javascript: zero - means bad integer??

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=7318>.
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=7318

javascript: zero - means bad integer??

           Summary: javascript: zero - means bad integer??
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Validator
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: artur.filipiak@gate.pl


there is a bug in javascript function validateInteger(form):
after parseInt there is condition:
if (!iValue || !(iValue >= -2147483648 && iValue <= 2147483647))
- in javascript when iValue is undefined or is zero, !iValue tells true.

should rather be:
if (isNaN(iValue) || !(iValue >= -2147483648 && iValue <= 2147483647))

i think the same is about validationg float, short etc.

salut.fish

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>