[jQuery] Hide and show inside JTabs
Hi all
I'm using JTabs with a big form for improve usability. Works like a charm. Inside this form I'll want to show/hide input fields when user checks/unchecks a radio button. But I have a problem. Using this sample script works fine outside JTabs:
Jquery code:
<script type="text/javascript">
$(document).ready(function(){
$("#show_property__pat_co").hide();//hides the DIV
$("input[@name='property__pat_co_yes_no']").click(function(){
if ($("input[@name='property__pat_co_yes_no'][@checked]").val() == "1"){
$("#show_property__pat_co").show();
}
else{
$("#show_property__pat_co").hide();
}
});
});
</script>
<form id="test" name="test">
<tr>
<td>More properties?</td>
<td>
<input name="property__pat_co_yes_no" type="radio" value="1" /> Yes <input name="property__pat_co_yes_no" type="radio" value="2" /> No
</td>
</tr>
<!--- this div needs to show only after user checked YES above --->
<!--- and needs to hide after checked NO above --->
<div id="show_property__pat_co">
<tr>
<td>Property Code</td>
<td><input name="property__pat_co" type="text" size="50" maxlength="22" /></td>
</tr>
<tr>
<td>Description</td>
<td><input name="property__pat_no" type="text" size="50" maxlength="22" /></td>
</tr>
<tr>
<td>Property Value</td>
<td><input name="property__pat_vr" type="text" size="50" maxlength="22" /></td>
</tr>
</div>
</form>
What's wrong? Could be JTabs properties?
Cheers
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/