You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "RAUL (JIRA)" <ji...@apache.org> on 2008/01/04 18:06:05 UTC

[jira] Updated: (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 ]

RAUL updated WW-2405:
---------------------

          Component/s: XML Validators
          Description: 
<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;
                }
            }
        }

  was:

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

    Affects Version/s: 2.0.9
                       2.0.11

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