Hello.
I'm trying to remove an additional radio selection if another radio button is
selected. There's suppose to be two additional selections if one particular
button is chosen. Then if the user picks another button then this additional
selection disappears.
I've been trying the removeChild method but it doesn't seem to be working.
The code is part of a larger form code, so I'll just post the problem area...
...
var radio_sel = document.getElementById("radiochoice");
radio_sel.onclick=function(){addRadioOpts();}
....
....
function addRadioOpts(){
var newcell1 = document.createElement('td');
var newInput1 = document.createElement('input');
newInput1.type = "radio";
newInput1.name = "movie";
newInput1.className = 'textstyle';
newInput1.value = 'swordfish';
var nameText1 = document.createTextNode("Swordfish");
var newInput2 = document.createElement('input');
newInput2.type = "radio";
newInput2.name = "movie";
newInput2.className = 'textstyle';
newInput2.value = 'perfect_stranger';
var nameText2 = document.createTextNode("Perfect Stranger");
newcell1.appendChild(newInput1);
newcell1.appendChild(nameText1);
newcell1.appendChild(newInput2);
newcell1.appendChild(nameText2);
var nextRow = document.getElementById("main_row");
var the_table = document.getElementsByTagName("tbody")[0];
var new_row = document.createElement('tr');
new_row.appendChild(newcell1);
var my_label = document.createElement('label');
my_label.className = 'textstyle';
my_label.id = "newlabel";
my_label.appendChild(new_row)
the_table.insertBefore(my_label, nextRow);
var radio_buttons = document.getElementsByName("beauty");
radio_buttons.onchange=function(){the_table.remove Child(my_label);}
return;
}
....
Any suggestion is appreciated...
--
Message posted via WebmasterKB.com
http://www.webmasterkb.com/Uwe/Forum...cript/200809/1