Hi I have a page I am working and I am having some trouble with:
I need to show and hide areas based on a radio selection.
I initally started using the show / hide feature in Jquery but the problem is the elements need to be removed but then put back if the user selects the radio button again as it has form elements that have validaion on them.
The validation is still trying to validate the form elements becuase they are still on the page but just not showing.
This is the radio group the user makes the selection from:
<input name="terms_usr" type="radio" id="terms_usr_1" value="1"/>
<label for="terms_usr_1">Credit Card</label>
<input type="radio" name="terms_usr" id="terms_usr_2" value="2"/>
<label for="terms_usr_2">C.O.D</label>
<input type="radio" name="terms_usr" id="terms_usr_3" value="3"/>
<label for="terms_usr_3">EFT</label>
_______________________________
Show if radio term_usr_1 checked
<table width="100%" border="0" id="terms1">
<tr>
<td align="left" valign="top"><
<input type="text" name="ccard_usr" id="ccard_usr" value="<?php echo KT_escapeAttribute($row_rsuser_usr['ccard_usr']); ?>" size="25" />
<select name="ccmonth_usr" id="ccmonth_usr" style="width:50px">
<option value="" <?php if (!(strcmp("", KT_escapeAttribute($row_rsuser_usr['ccmonth_usr'])))) {echo "selected=\"selected\"";} ?>>Select - Month</option>
</select>
<select name="ccyear_usr" id="ccyear_usr" style="width:50px">
option value="" >Select - Year</option>
</select>
<input name="cccode_usr" type="text" id="cccode_usr" value="" size="4" maxlength="4" />
</td>
</tr>
</table>
_______________________________
Show if radio term_usr_2 checked
<table width="100%" border="0" id="terms2">
<tr>
<td align="left" valign="top"><img src="../../img/layout/icon_truck.jpg" width="110" height="73" /></td>
<td align="left" valign="top" style="color:#CC0000">Please pay your rep on delivery<br />
<input name="ccard_usr" type="hidden" id="ccard_usr" value="0000000000000000" />
<input name="ccmonth_usr" type="hidden" id="ccmonth_usr" value="10" />
<input name="ccyear_usr" type="hidden" id="ccyear_usr" value="10" />
<input name="cccode_usr" type="hidden" id="cccode_usr" value="123" />
</td>
</tr>
</table>
____________________________
Show if radio term_usr_3 checked
<table width="100%" border="0" id="terms3">
<tr style="color:#CC0000">
<td align="left"><img src="../../img/layout/logo_anz.jpg" name="anzlogo" id="anzlogo" /></td>
<td align="left" valign="top">
Corporate Pty Ltd<br />
BSB 00000<br />
ACCOUNT 00000000<br />
<input name="ccard_usr" type="hidden" id="ccard_usr" value="0000000000000000" />
<input name="ccmonth_usr" type="hidden" id="ccmonth_usr" value="10" />
<input name="ccyear_usr" type="hidden" id="ccyear_usr" value="10" />
<input name="cccode_usr" type="hidden" id="cccode_usr" value="123" />
</td>
</tr>
</table>
Ultermately I would like the hidden feilds to show in a separate div id but only show if the element terms1 is not showing. I am happy to put the items in a div tag rather than a table with an id.
Any help would be appreciated.