chuckles
Status: New User - Welcome
Joined: 19 Sep 2005
Posts: 1
Back to top
Posted: Sep 19, 05, 9:19    change value of radio button
How do I change the value of a radio button?

I want to change the selection based on an event. Let's say clicking another button.
rkoenig
Status: Interested
Joined: 04 Oct 2003
Posts: 16
Back to top
Posted: Sep 19, 05, 11:02    
That's pretty easy, here's a simple version:

:: Code ::
<form name="theForm" action="radio-switch.htm" method="post">
<input type="radio" name="test">
<input type="radio" name="test">
<input type="radio" name="test">
</form>
<a href="#" onclick="theForm.test[1].checked = true;">test</a>

Works fine as you can see. Obviously you'd be changing the test.[1] value dynamically, that's just hard coded in for demonstration purposes.
Display posts from previous:   

All times are GMT - 8 Hours