Hi,
i want to validate textfield which should allow only number 0-9 in any range how can i implement this
Thanks Shakil
Hi,
i want to validate textfield which should allow only number 0-9 in any range how can i implement this
Thanks Shakil
I'm not sure what you mean by "in any range". To do numeric validation you can use the int validator:
<validator type="int">
<param name="fieldName">myfield</param>
<param name="min">0</param>
<param name="max">9</param>
<message>MyField needs to be between ${min} and ${max}</message>
</validator>
I assume you just want integers and not real numbers.
This page describes all the validators that are available.
Struts2 ships with pretty good documentation. Learn how to use it :)