Hi,
I am part of a project where in a form i have 3 field where the user can enter
amount values and my requirement is i need to allow the user to enter amount in
the following formats.
1. user can enter the amount alone.
2. It should allow only 2 decimal places to be entered.
3. User can append a $ sign in the beginning
4. User can give "," (Coma's) to indicate 1000, 100 ets eg. 10,000.
5. the amount validators are not mandatory. So this validation should happen
only if the user enter an amount into the amount field.
I am using xdoclet to generate my form from the domain object and am using this
same domain object for another screen also for listing. So i need to give
struts-validator entries on top of the amounts getter method.
If any one has the xml regular expression for accomodating this please be of
help.
Could someone help me out in writing a custom validator for this and tell me
how effictely to do it. I would appreciate it if you could respond immediately
as the requirement is urgent and of high priority.
Thank you.
Regards
Sharon