This piece of code I have written works, but I don't think its the best solution.
What I am doing is check if a certain radio is checked if it is show this div if else show this div if this radio is checked etc.
Can someone point me in the right direction on this one? I would love to know how to write less do more.
$(document).ready(function () {
$('.Form').hide();
$('input').click(function () {
<!--check if its One-->
if ($('input[value=informed]:checked').length) {
$('#ContactFormOne').show();
$("#ContactFormTwo, #ContactFormThree, #ContactFormFour, #ContactFormFive, #ContactSix'").hide();
<!--check if its Two-->
} else if ($('input[value=release]:checked').length) {
$('#ContactFormTwo').show();
$("#ContactFormOne, #ContactFormThree, #ContactFormFour, #ContactFormFive, #ContactSix'").hide();
<!--check if its Three-->
} else if ($('input[value=intake]:checked').length) {
$('#ContactFormThree').show();
$("#ContactFormTwo, #ContactFormOne, #ContactFormFour, #ContactFormFive, #ContactSix'").hide();
<!--check if its Four-->
} else if ($('input[value=checklist]:checked').length) {
$('#ContactFormFour').show();
$("#ContactFormTwo, #ContactFormOne, #ContactFormThree, #ContactFormFive, #ContactSix'").hide();
<!--check if its Fiver-->
} else if ($('input[value=health]:checked').length) {
$('#ContactFormFive').show();
$("#ContactFormTwo, #ContactFormOne, #ContactFormThree, #ContactFormFour, #ContactSix'").hide();
}
})
});
id
for the form elements? \$\endgroup\$