.removeChild Not Working...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ChuckB via WebmasterKB.com

    .removeChild Not Working...

    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.getEle mentById("radio choice");
    radio_sel.oncli ck=function(){a ddRadioOpts();}
    ....

    ....
    function addRadioOpts(){


    var newcell1 = document.create Element('td');


    var newInput1 = document.create Element('input' );
    newInput1.type = "radio";
    newInput1.name = "movie";
    newInput1.class Name = 'textstyle';
    newInput1.value = 'swordfish';
    var nameText1 = document.create TextNode("Sword fish");


    var newInput2 = document.create Element('input' );
    newInput2.type = "radio";
    newInput2.name = "movie";
    newInput2.class Name = 'textstyle';
    newInput2.value = 'perfect_strang er';
    var nameText2 = document.create TextNode("Perfe ct Stranger");

    newcell1.append Child(newInput1 );
    newcell1.append Child(nameText1 );
    newcell1.append Child(newInput2 );
    newcell1.append Child(nameText2 );


    var nextRow = document.getEle mentById("main_ row");

    var the_table = document.getEle mentsByTagName( "tbody")[0];

    var new_row = document.create Element('tr');
    new_row.appendC hild(newcell1);

    var my_label = document.create Element('label' );
    my_label.classN ame = 'textstyle';
    my_label.id = "newlabel";

    my_label.append Child(new_row)
    the_table.inser tBefore(my_labe l, nextRow);

    var radio_buttons = document.getEle mentsByName("be auty");
    radio_buttons.o nchange=functio n(){the_table.r emoveChild(my_l abel);}


    return;
    }
    ....

    Any suggestion is appreciated...

    --
    Message posted via WebmasterKB.com


  • ChuckB via WebmasterKB.com

    #2
    Re: .removeChild Not Working...

    Sorry for the double post...system was acting up..

    --
    Message posted via WebmasterKB.com


    Comment

    Working...