hey! here's another cool thing that i found…
getting irritated of that nasty "setting a property that has only a getter" error?
that error is caused when you tried to change something that couldn't be changed or add something that could not be added.. some element attributes are read-only and cannot be modified such as xul's selected attribute in it's radio button implementation
<radio label="Dinner Time" name="options" id="dinner" value="4" disabled="true" selected = true />
if you put in your javascript something like:
if (document.getElementById('foobaz') == true) {
document.getElementById('lunch').selected = false;
}
thinking that selected will be set to false.. well in xul there is no selected = false, it's either selected = true or no selected attribute at all…
well what if you wanted to not select it you can use a javascript function called removeAttribute it removes the selected attribute so the radio button is not selected and the value will be nothing..
if (document.getElementById('foobaz') == true) {
document.getElementById('lunch').removeAttribute('selected');
}
now, what if you want to place it to another? simply use the setAttribute function like so:
if (document.getElementById('foobaz') == true) {
document.getElementById('lunch').removeAttribute('selected');
document.getElementById('dinner').setAttribute('selected',true);
}
it adds an attribute selected and assigns it as true.
now as for the values for the radiogroup maybe you can use the value function..
hope that helps ^^, feel free to comment if you have any questions ^^,