I would like to show/hide fields based on whether a struts2 checkbox is checked or not. Here is my code:
<s:checkbox label="Show/Hide" name="showHide" />
<s:textfield required="false" label="Extra Details" name="person.extraDetails" />
So when the user checks “showHide” then it should show “person.extraDetails”. When they uncheck it should hide it.
lot of way to achieve this
sample with jquery:
Script