I don't see a:
Code:
document.getElementById("main_relocate")
which would be an element with an id of 'main_relocate', anywhere in your markup. I do see three with a name of 'main_relocate'.
The red parts don't do anything I am aware of. I think that they are invalid:
Code:
<input type="radio" name="main_relocate" tabindex="3" value="1" {RELOCATE_YES} /> {L_YES}
<input type="radio" name="main_relocate" tabindex="4" value="0" {RELOCATE_NO} /> {L_NO}
<input type="radio" name="main_relocate" tabindex="5" value="2" {RELOCATE_MAYBE} /> {L_MAYBE}
If I wanted to set these buttons, I would probably just do it via their order in the markup, collecting them by their name. But, since you seem to want to do it in connection with their value, here goes:
Code:
<script type="text/javascript">
function setBut(n, v){
for (var i = 0, b=document.getElementsByName(n); i < 2*b.length; i++)
if(b[i])
b[i].checked=0;
else if(b[i-b.length].value==v)
b[i-b.length].checked=1;
}
</script>
HTML Code:
<table>
<tr>
<td class="row2" width="78%"> <span class="gen">
<input type="radio" name="main_relocate" tabindex="3" value="1"> {L_YES}
<input type="radio" name="main_relocate" tabindex="4" value="0"> {L_NO}
<input type="radio" name="main_relocate" tabindex="5" value="2"> {L_MAYBE}
</span> </td>
</tr>
</table>
<div>
<input type="button" value="Yes" onclick="setBut('main_relocate', 1);"><br>
<input type="button" value="No" onclick="setBut('main_relocate', 0);"><br>
<input type="button" value="Maybe" onclick="setBut('main_relocate', 2);">
</div>
Bookmarks