News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

weird javascript problem

Started by Cadish, August 01, 2005, 03:45:18 AM

Previous topic - Next topic

Cadish

Hi,

I've this in my html:

onClick="disableIt(document.form.radioButton1); disableIt(document.form.radioButton2); "
function disableIt(obj)
{
obj.checked = false;
for (i=0;i<document.form.elements.length;i++){
document.form.elements[i].disabled = false;
}
obj.disabled = !(obj.disabled);
}


It just disables radioButton2... Why doesn't it disable radioButton1 too?
If I add more radioButtons, it only disables the last one in the onClick syntax...  >:(

What can I do??

Cadish

Stupid me...

I've already found it... I always did this

for (i=0;i<document.form.elements.length;i++){
document.form.elements[i].disabled = false;
}


So that was my problem...

Advertisement: