struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan Aylward (JIRA)" <j...@apache.org>
Subject [jira] Commented: (WW-1937) javascript validation error when int range above 1000
Date Wed, 07 Nov 2007 00:08:34 GMT

    [ https://issues.apache.org/struts/browse/WW-1937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42581
] 

Ryan Aylward commented on WW-1937:
----------------------------------

This issues is still occurring in 2.0.9. We are using 2.0.9 and we are still getting the comma
separator which causes javascript to evaluate the integer incorrectly. 

For reference, here's what we have in our pom which indicates we are using 2.0.9
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-core</artifactId>
            <version>2.0.9</version>
        </dependency>

Here's a snippet of the javascript that was generated for an int range check...
 if (form.elements['inputField']) {
    field = form.elements['inputField'];
    var error = "Invalid range for input field.";
    if (field.value != null) {
        if (parseInt(field.value) <  2,003 ||  parseInt(field.value) > 5,000) {
            addError(field, error);
            errors = true;
        }
    }
}

> javascript validation error when int range above 1000
> -----------------------------------------------------
>
>                 Key: WW-1937
>                 URL: https://issues.apache.org/struts/browse/WW-1937
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.0.6
>            Reporter: Wang Sheng
>             Fix For: 2.0.9
>
>
> we use javascript validation, check int range
> min or max above 1000(include), the jsp was rendered as "1,000", so it can not do validate
correctly.
> struts2-core-2.0.6.jar\template\xhtml\form-close-validation.ftl
> ${validator.min} should be ${validator.min?c}
> ${validator.max} should be ${validator.max?c}
> there maybe lots other problems
> this bug also affects webwork 2.2.2/2.2.4, and struts 2.0.0 - 2.0.6
> not test 2.0.7

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message