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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing options displayed

Status
Not open for further replies.

ScrabbleKing

Programmer
Mar 11, 2007
20
0
0
US
How do I make it so that choosing:

Selection 123 displays Option ABC, DEF, GHI
Selection 456 displays Option JKL, MNO
Selection 789 displays Option PQR, STU, VWX, YZ

Code:
<html>

<head>
  <title></title>
<script language="JavaScript" type="text/javascript">
<!--

var Last;

function CngOption(optid){
 if (Last){
  document.getElementById('options').appendChild(Last);
 }
 else {
  document.getElementById('options').appendChild(document.getElementById('display').firstChild);
 }
 Last=document.getElementById(optid)
 document.getElementById('display').appendChild(Last);
}
//-->
</script></head>

<body>
<table border="1" width="800" height="200">
  <tr>
    <td width="20%">1</td>
    <td id="display" >2</td>
  </tr>
</table>

<table>
<td width="800" align="center">
<input type="radio" name="Option" onclick="CngOption('ABC');" > ABC
<input type="radio" name="Option" onclick="CngOption('DEF');" > DEF
<input type="radio" name="Option" onclick="CngOption('GHI');" > GHI<br>
</div>
</table>


<table>
<td width="800" align="center">
<input type="radio" name="Selection" > 123<br>
<input type="radio" name="Selection" > 456<br>
<input type="radio" name="Selection" > 789<br>
</div>
</table>


<DIV id="options" style="position:absolute;visibility:hidden;" >

<form id="ABC" action="[URL unfurl="true"]http://www.ABC.com/">[/URL]
<fieldset>
<legend>ABC</legend>
</fieldset>
</form>

<form id="DEF" action="[URL unfurl="true"]http://DEF.com/">[/URL]
<fieldset>
<legend>DEF</legend>
</fieldset>
</form>

<form id="GHI" action="[URL unfurl="true"]http://GHI.com">[/URL]
<fieldset>
<legend>GHI</legend>
</fieldset>
</form>

<form id="JKL" action="[URL unfurl="true"]http://JKL.com/">[/URL]
<fieldset>
<legend>JKL</legend>
</fieldset>
</form>

<form id="MNO" action="[URL unfurl="true"]http://MNO.com/">[/URL]
<fieldset>
<legend>MNO</legend>
</fieldset>
</form>

<form id="PQR" action="[URL unfurl="true"]http://PQR.com/">[/URL]
<fieldset>
<legend>PQR</legend>
</fieldset>
</form>

<form id="STU" action="[URL unfurl="true"]http://STU.com/">[/URL]
<fieldset>
<legend>STU</legend>
</fieldset>
</form>

<form id="VWX" action="[URL unfurl="true"]http://VWX.com/">[/URL]
<fieldset>
<legend>VWX</legend>
</fieldset>
</form>

<form id="YZ" action="[URL unfurl="true"]http://YZ.com/">[/URL]
<fieldset>
<legend>YZ</legend>
</fieldset>
</form>
</DIV>
</body>

</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top