Okay, well here's the gist of ONE way to do it, using stylesheets and <div> elements.
Create a style called "Invisible"
.Invisible
{
visibility: hidden;
}
.Visible
{
visibility: visible;
}
Put each of your HTML bodies into their own <div> element. Give each <div> it's own unique ID. Set the class attribute of each <div> to be "Invisible" to begin with.
each of your radio buttons will have a value. Give each radio button an onClick() that sets it's corresponding <div> to visible, and the others to "invisible".
<script language="JavaScript">
<!--
var activeDiv = '';
function make_visible(targetDiv)
{
var previous;
if (activeDiv != '')
{
previous = document.getElementById(activeDiv);
if (activeDiv != targetDiv)
{
previous.className = "Invisible";
}
}
var newActive = document.getElementById(targetDiv);
newActive.className = "Visible";
activeDiv = targetDiv;
}
<input type="radio" name="my_radio" value="div_1" onClick="javascript
:make_visible('div_1')"/>Div 1
<input type="radio" name="my_radio" value="div_2" onClick="javascript
:make_visible('div_2')"/>Div 2
<input type="radio" name="my_radio" value="div_3" onClick="javascript
:make_visible('div_3')"/>Div 3
<div class="Invisible" id="div_1">bla bla bla bla</div>
<div class="Invisible" id="div_2">ooga booga booga</div>
<div class="Invisible" id="div_3">foo bar baz quux</div>
Hope this gives you enough pieces to fit together.
Take care,
Nik
http://www.bigaction.org/