Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to hide the text box field when radio button is clicked?

navneet nischal January 20, 2012

please mention the steps where the javascript is to be written and also the code. i have two radio button yes/no . by default NO is checked, i need when user clicks YES radio button the TEXT BOX should appear.

thanx in advance

1 answer

0 votes
StaceyA
Contributor
February 6, 2012

You can use the events of a radio button to show the text box. If you want to be a little more robust, you can use the "checked" flag to achieve the same effect. A good reference for this is http://www.hscripts.com/tutorials/javascript/dom/radio-events.php

<input type="radio" class="yesRadio" onClick="showTextBox()"/>

<input type="text" class="textBox" hidden/>



<script type="text/javascript>

function showTextBox() {

	$(".textBox").show();

}

</script>

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events