Setting a Radio Button value using Javascript
After much research, I've figured out that the appropriate command to get the value of a Radio Button in APEX JavaScript is "html_RadioValue", but I haven't been able to figure out a command that will let you set the value of the Radio Button. Is there documentation on APEX's use of JavaScript that covers this issue?
Here's a simplified version of the script:
<script language="JavaScript" type="text/javascript">
function showval()
{
var item1 = html_RadioValue('P19_RADIO');
alert(item1);
//Reverse the current selection
if (item1 == 'Y') then
{
<mystery_statement> //set P19_RADIO to N.
}
else
{
<mystery_statement> //set P19_RADIO to Y.
}
}
</script>
I've tried the following, but none of them have worked:
- document.getElementById("P19_RADIO").value = 'N';
- document.getElementById("P19_RADIO").checked = 'N';
- $x('P19_RADIO').value = 'N';
- $x('P19_RADIO').checked = 'N';
Thanks.