Hi,
This is a test for a larger form i am working on. I want to have a
real time
display of the radio button value when selected. I tried with various event
handlers with varying success. The code below works in mac/win firefox,
other browsers don't handle it at all. I have tried using onclick, and that
buggers it in all browsers.
<script type="text/javascript">
function updateSize()
{if(document.testform.size[0].checked==true)
document.getElementById('displaySize').innerHTML =
document.testform.size[0].value;
if(document.testform.size[1].checked==true)
document.getElementById('displaySize').innerHTML =
document.testform.size[1].value;
}
<form name="testform">
<input type="radio" id="1" name="size" value="1" onchange="updateSize();
return false;"><label for="1">1"</label><br />
<input type="radio" id="1.25" name="size" value="1.25"
onchange="updateSize(); return false;"><label for="1.25">1.25"</label>
</form>
<p>Size: <span id="displaySize"></span></p>
this site has something similar but has different names for each radio
button
and manually sets the opposite button checked = false. I don't want to do
this because this will cause problems with javascript disabled.
http://webmonkey.wired.com/webmonkey...tw=programming
How should i go about this?
chuck