File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Validate integer fails for zero values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validate integer fails for zero values" Watch "Validate integer fails for zero values" New topic

Validate integer fails for zero values

Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
In my validation.xml I have an entry:
<field property="id_article" depends="required,integer" >
<arg0 key="app.validator.error.id_article"/>

Everything works OK unless I enter 0 (zero) into "id_article" text field on my JSP. In that case JavaScript alerts a message saying 0 is not an integer.

I know there was a problem with parseInt() function in JavaScript 1.0, but I'm using IE6 and JavaScript1.1.

What is goin' on?
Consider Paul's rocket mass heater.
subject: Validate integer fails for zero values
Similar Threads
doubt in using validwhen
Hashtable iteration
Data Field and Method question
Struts Validator-Validating an Integer Form Field
STRUTS:client-side validation using validation.xml for hidden field results in error