| Author |
validate only if field is visible?
|
shah rah
Ranch Hand
Joined: Jan 04, 2007
Posts: 124
|
|
I have a radio button Yes/No. If user clicks 'No' I make the hidden text box visible. this textbox validation should trigger if it is empty. How to do this? if user pressed YES then the validation should not fire. can this be done using struts validation.xml or I should stick to client side javascript?
|
 |
Merrill Higginson
Ranch Hand
Joined: Feb 15, 2005
Posts: 4864
|
|
|
You should be able to do this with a "validWhen" validation. See the heading "Conditionally Required Fields" in this link for more information.
|
Merrill
Consultant, Sima Solutions
|
 |
 |
|
|
subject: validate only if field is visible?
|
|
|