views:

71

answers:

0

Hi,

I'm using Struts built in validation framework. One of the form fields should be validated so it only allows a numeric value but it is not mandatory to enter a value at all so it can be left blank.

Initially I thought this would be easy as there is support for depends=double or even mask and supply a regex but with the mask option you need to have the required value as part of the depends. When I enter a non numeric for depends=double it doesn't give a warning just resets value to 0 and continues with form submission.

Thanks in advance