You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Musachy Barroso (JIRA)" <ji...@apache.org> on 2008/07/21 21:14:05 UTC

[jira] Resolved: (WW-2405) Validation error , javascript error with number big

     [ https://issues.apache.org/struts/browse/WW-2405?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Musachy Barroso resolved WW-2405.
---------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: Future)
                   2.1.3

This was fixed already, FreeMarker formats numbers by default, adding ?c to the value prints the number without formatting

> Validation error , javascript error with number big
> ---------------------------------------------------
>
>                 Key: WW-2405
>                 URL: https://issues.apache.org/struts/browse/WW-2405
>             Project: Struts 2
>          Issue Type: Bug
>          Components: XML Validators
>    Affects Versions: 2.0.9, 2.0.11
>         Environment: Struts2, Jboss 4,05,  WIndows, Java 5
>            Reporter: RAUL
>             Fix For: 2.1.3
>
>
> <field name="nroExample">
>    <field-validator type="required">
> 	<message key="example.required"></message>
>  </field-validator>
>  <field-validator type="int">
>      <param name="min">0</param>
>      <param name="max">2147483647</param>
>                        <message key="common.error.field.value"></message>
>   </field-validator>
> </field>
> it generates javascript error. 
> the code source shows. 
> the error happens when the parameter max is big number as 2147483647
>   // field name: nroExample
>         // validator name: int
>         if (form.elements['nroExample']) {
>             field = form.elements['nroExample'];
>             var error = "Invalid field value for field";
>             if (field.value != null) {
>                 if (parseInt(field.value) <
>                      0 ||
>                         parseInt(field.value) >
>                            2.147.483.647) {
>                     addError(field, error);
>                     errors = true;
>                 }
>             }
>         }

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