By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,525 Members | 1,212 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,525 IT Pros & Developers. It's quick & easy.

Dynamic Radio button problem

P: 1
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.createElement("input");
option.type = "radio";
option.name="radGroup";
option.id = xmlValues[j];
option.value = xmlValues[j];
//if(j==0){option.defaultChecked = true; option.checked = true; };
mycurrent_cell.appendChild(option);
// appends the cell <td> into the row <tr>
mycurrent_row.appendChild(mycurrent_cell);
mycurrent_cell.setAttribute("align", "center");

thanks
murali
Jul 24 '06 #1
Share this Question
Share on Google+
1 Reply


P: 3
Hii muralidharan_vak !!

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.createElement("TD");
mycurrent_cell.innerHTML=radiobtnString
mycurrent_row.appendChild(mycurrent_cell)

Hope this will help you
Aug 5 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.