I am having 3 radio buttons approved and rejected and 4 text fields and text boxes..
If i am clicking r1, all the text field and text boxes should be hided. but if i am clicking r2 and r3 the text field and text box should be displayed..
This is the code which i have used
if(approved.checked == true) {
reason.style.visibility="hidden"; Reason.style.visibility="hidden"; sanction.style.visibility="display"; sanctioned.style.visibility="display"; } if(rejected.checked == true) { reason.disabled =false; reason.style.display="none"; Reason.style.display="none"; sanction.style.visibility="hidden"; sanctioned.style.visibility="hidden"; }
This code is working for the first time when i click those radio buttons. But if am clicking rejected and then clicking approved it is not working.
display:noneandvisibility:hiddenare not completely analogous. I'd use one or the other, but not both.