Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Radio Button Question

Status
Not open for further replies.

gvolk

IS-IT--Management
Nov 20, 2003
2
US
I'm using ASP.NET and I want to display two data grids, each when there coresponding radio button is selected one at a time. Any help appreciated.
 
Generate the html for both and give each a different ID (Ex. tbl1 and tbl2). In the second, use the attribute style="DISPLAY: none".
Create a function for the onclick event of each radio button such as:

Radio button 1
onclick="JavaScript: document.all('tbl2').style.display='none'; document.all('tbl1').style.display='block';"

Radio button 2
onclick="JavaScript: document.all('tbl1').style.display='none'; document.all('tbl2').style.display='block';"

Each time a radio button is selected, one table is hidden and one is displayed.
 
That works but my Data Grids appear in different place on the page. Is it possible to have them appear in the exact same spot?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top