[
https://issues.apache.org/struts/browse/WW-2084?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
James Holmes updated WW-2084:
-----------------------------
Fix Version/s: 2.1.0
Assignee: James Holmes
> Double and int validation not generating good Javascript
> --------------------------------------------------------
>
> Key: WW-2084
> URL: https://issues.apache.org/struts/browse/WW-2084
> Project: Struts 2
> Issue Type: Bug
> Affects Versions: 2.1.0
> Environment: Windows XP, JDK 5
> Reporter: Leneveut Michaël
> Assignee: James Holmes
> Fix For: 2.1.0
>
> Attachments: Test.war
>
>
> If I put int or double validation, the Javascript in not well generated, and
> the fields are not validated, due to "false" expressions in the javascript
> "if" tests.
> <validators>
> <field name="familleProduit.chargeTravail">
> <field-validator type="double">
> <message key="errors.double"/>
> </field-validator>
> </field>
> </validators>
> Generated Javascript onsubmit method :
> // field name: familleProduit.chargeTravail
> // validator name: double
> if (form.elements['familleProduit.chargeTravail']) {
> field = form.elements['familleProduit.chargeTravail'];
> var error = "Le champ doit être un décimal";
> if (field.value != null) {
> var value = parseFloat(field.value);
> if (false ||
> false ||
> false ||
> false) {
> 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.