struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 17622] New: - Client-side validation for integer creates no "alert"
Date Tue, 04 Mar 2003 00:07:00 GMT
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=17622>.
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=17622

Client-side validation for integer creates no "alert"

           Summary: Client-side validation for integer creates no "alert"
           Product: Struts
           Version: 1.1 RC1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Validator Framework
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: sditlinger@ebuilt.com


If non-numeric text is entered, users do not get an alert telling them they 
entered a non-integer entry.  Server-side validation still takes place, so all 
is not lost.  (Saves it from being a "Critical" bug. :-)

The javascript in the validation.xml for validating integers contains this:
...
if (value.length > 0) {   
     if (!isAllDigits(value)) {   
        bValid = false;   
     } else {...parseInt and other checks... }
...
What it needs to do is something like this:
...
if (value.length > 0) {   
     if (!isAllDigits(value)) { 
        fields[i++] = oInteger[x][1];  
        bValid = false;   
     } else {...parseInt and other checks... }
...

This is because fields.length is used to determine whether or not an "alert" 
should appear.  Another possible fix is to just eliminate the call 
to "isAllDigits()" and rely on the "parseInt and other checks".  None of the 
other "validate<NumericType>" javascript funtions use the "isAllDigits()" 
function.

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