You can use jQuery to achieve this:
Here is the HTML code:
a<input type="checkbox" name="newsletter" value="Daily" />
b<input type="checkbox" name="newsletter" value="Weekly" />
c<input id="test" type="checkbox" name="newsletter" value="Monthly" />
<input id="txtbox" type="text">
d<input type="checkbox" name="newsletter" value="Yearly" />
Here's jQuery:
$(document).ready(initialize);
function initialize() {
$("input#txtbox").hide();
$(":checkbox").click(countChecked);
}
function countChecked() {
if ($("input#test").is(':checked')) {
$("input#txtbox").show();
}
else {
$("input#txtbox").hide();
}
}
Here is a demo
Here is the source of information
source
share