struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "RAUL (JIRA)" <j...@apache.org>
Subject [jira] Updated: (WW-2405) Validation error , javascript error with number big
Date Fri, 04 Jan 2008 17:06:05 GMT

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


Mime
View raw message