I\'m new to jquery, but I\'m trying to use it to create a multi-step tabbed form.
One one of the pages, I have radio buttons that will show several fields depending on t
Slightly modifying your jquery by extracting out a method:
$(document).ready(function() {
//...stuff
ShowHidePanels();
$("input[name='paymentmethod']").change(function() {
ShowHidePanels();
});
function ShowHidePanels(){
if( $("input[name='paymentmethod']:checked").val() == "cheque")
{
$("#divcredit").hide();
$("#divcheque").show();
}
else if($("input[name='paymentmethod']:checked").val()== "creditcard")
{
$("#divcredit").show();
$("#divcheque").hide();
}
};
});