...

View Full Version : Hide table with Radio Button



StephenCassidy
01-14-2004, 12:23 PM
Hi all,

I have got a page with a pair of radio buttons Yes and No, when the user selects Yes I would like a table to be displayed otherwise I would like it to be hidden.

I have seen an example on the internet but that hid a textbox but I couldnt figure out how it worked or how to modify it to hide a table.

Thanks

Stephen

Danne
01-14-2004, 12:51 PM
Something like this should do it:


Show table
<form>
<input type="radio" name="rdoView" onclick="document.getElementById('tableID').style.display='block';"> Yes
<input type="radio" name="rdoView" onclick="document.getElementById('tableID').style.display='none';"> No
</form>
<table id="tableID">
...

StephenCassidy
01-14-2004, 01:47 PM
Perfect.

Thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum