I have 2 radio buttons A & B. the B button also have one text field.By default next button is hidden and it should appear in the following cases[*]If user click button A[*]User click button B and enter text in the textfieldI try this:JavaScript\[code\]window.onload=function(){ document.getElementById("next").style.display='none';} function shownext(){ var A = document.getElementById('A').value; var B = document.getElementById('B').value; var name = document.getElementById('name').value; if(A != "" || (B != "" && name != "")){ document.getElementById("next").style.display='block'; return false; } if(A == "" && B == "" && name == ""){ document.getElementById("next").style.display='none'; return false; }}\[/code\]HTML\[code\]<input type="radio" name="A" id="A" value="http://stackoverflow.com/questions/14433992/A" onClick="shownext();"/><input type="radio" name="A" id="B" value="http://stackoverflow.com/questions/14433992/B" onClick="shownext();"/><input type="text" name="name" id="name" onKeyDown="shownext();" onKeyUp="shownext();"/><a href="http://stackoverflow.com/questions/14433992/#q2" id="next"><img src="http://stackoverflow.com/questions/14433992/next.png"/></a>\[/code\]