Code: Select all
<input type="radio" name="nm" value="1" onClick="document.getElementById('textbox').innerHTML='<? echo $mrtg; ?>'"/> 1
</td>
</tr>
</table>
<span id="textbox" align="left"></span>Moderator: General Moderators
Code: Select all
<input type="radio" name="nm" value="1" onClick="document.getElementById('textbox').innerHTML='<? echo $mrtg; ?>'"/> 1
</td>
</tr>
</table>
<span id="textbox" align="left"></span>Code: Select all
<input type="radio" name="nm" value="1" onClick="document.getElementById('textbox').style.display='block';" /> 1
</td>
</tr>
</table>
<span id="textbox">
<form id="frm">
<!-- whatever -->
</form>
</span>
Code: Select all
<input type="radio" name="nm" value="1" onClick="document.getElementById('mrtg1').style.display='block'" /> 1
<input type="radio" name="nm" value="2" onClick="document.getElementById('mrtg2').style.display='block'" /> 2
<input type="radio" name="nm" value="3" onClick="document.getElementById('mrtg3').style.display='block'" /> 3
<input type="radio" name="nm" value="4" onClick="document.getElementById('mrtg4').style.display='block'" checked="checked" /> None
<span id="mrtg1">
display if 1 is clicked
</span>
<span id="mrtg2">
display if 2 is clicked
</span>
<span id="mrtg3">
display if 3 is clicked
</span>
<span id="mrtg4">
empty span tags so that nothing displays
</span>Code: Select all
<style type="text/css">
.mrtg1, .mrtg2, .mrtg3 {
display:none;
}
</style>
<script type="text/javascript">
var currDisp;
function showInfo(num)
{
if(currDisp)
document.getElementById('mrtg'+currDisp).style.display = 'none';
if(num >= 1 && num <= 3)
{
document.getElementById('mrtg'+num).style.display = 'block';
currDisp = num;
}
else
currDisp = '';
}
</script>
<input type="radio" name="nm" value="1" onClick="showInfo(1)" /> 1
<input type="radio" name="nm" value="2" onClick="showInfo(2)" /> 2
<input type="radio" name="nm" value="3" onClick="showInfo(3)" /> 3
<input type="radio" name="nm" value="4" onClick="showInfo(4)" /> None
<span id="mrtg1">
display if 1 is clicked
</span>
<span id="mrtg2">
display if 2 is clicked
</span>
<span id="mrtg3">
display if 3 is clicked
</span>
Code: Select all
<form name="myform">
<select name="nm" size="1" onChange="displaydesc(document.myform.nm, thetext1, 'textcontainer1')">
<option value="0" selected>None</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<span id="textcontainer1" align="left"></span>
</form>
<script type="text/javascript">
var thetext1=new Array()
thetext1[0]=""
thetext1[1]="php variable1"
thetext1[2]="php variable2"
thetext1[3]="php variable3"
function displaydesc(which, descriptionarray, container){
if (document.getElementById)
document.getElementById(container).innerHTML=descriptionarray[which.selectedIndex]
}
</script>