do********@gmail.com wrote:
I'm wanting to have a set of radio buttons disabled when a form is
displayed, then if they check another specific radio button, those
would become enabled. I've tried setting it via
window.document.formname.radiogroup.disabled="true "; (or false) - but
that doesn't seem to work.
Elements with the same name, especially all radio buttons of a button
group, create a HTMLCollection object in the DOM. The property value
is of type `boolean', not of type `string'.
<URL:http://www.w3.org/DOM-Level-2-HTML/html.html#ID-50886781>
It should be something like this:
var rbs = window.document.forms['formname'].elements['radiogroup'];
for (var i = rbs.length; i--;)
{
rbs[i].disabled = true; // or false
}
Consider disabling a `fieldset' element that contains the radio button
group, instead (untested), and be sure to do feature tests on runtime.
<URL:http://jibbering.com/faq/#FAQ4_13>
<URL:http://pointedears.de/scripts/test/whatami>
PointedEars