Dynamic Radio button problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • muralidharan_vak
    New Member
    • Jul 2006
    • 1

    Dynamic Radio button problem

    Hi guys,

    I am using dynamic radio button list using javascript, actually i got a radio list .when i click those buttons ,it doesn't allow to check.please help me resolve this problem..

    option = document.create Element("input" );
    option.type = "radio";
    option.name="ra dGroup";
    option.id = xmlValues[j];
    option.value = xmlValues[j];
    //if(j==0){option .defaultChecked = true; option.checked = true; };
    mycurrent_cell. appendChild(opt ion);
    // appends the cell <td> into the row <tr>
    mycurrent_row.a ppendChild(mycu rrent_cell);
    mycurrent_cell. setAttribute("a lign", "center");

    thanks
    murali
  • vinod_yadav1919
    New Member
    • Jul 2006
    • 3

    #2
    Hii muralidharan_va k !!

    With your script you need to create function that will call to make radiobutton checked after adding radio button is added to the cell

    Alternatively I used following style to avoid such problem

    checkedString=" checked"

    radiobtnString= "<input type='radio' "+checkedString +" id='roleRadio' name='roleRadio ' value='0' >No "

    mycurrent_cell= document.create Element("TD");
    mycurrent_cell. innerHTML=radio btnString
    mycurrent_row.a ppendChild(mycu rrent_cell)

    Hope this will help you

    Comment

    Working...