...

View Full Version : radio button/check box - selecting default- problem DOM2



sudhakar_jr
11-28-2005, 01:42 PM
var tbl=document.createElement('TABLE');
var tr1=tbl.insertRow();
var td1=tr1.insertCell();
var rbtn1=document.createElement("<INPUT name='rbLop'>");// only with
INPUT and type='radio' not allowing me even to select
rbtn1.type='radio';
rbtn1.id='rbtn1';
//rbtn1.checked='checked';
//rbtn1.checked;
//rbtn1.checked='true';
var rbtn2=document.createElement("<INPUT name='rbLop'>");
rbtn2.type='radio';
rbtn2.id='rbtn2';
td1.appendChild(rbtn1);
td1.appendChild(rbtn2);
document.body.appendChild(tbl);


in above code i want the first button to be selected by default. but in
dom2 i am not able to do, but i am in bad need of it. please tell me
the alternate way and i hope there should be some ways. urgent
please............

indeterminate is also not working

http://www.w3.org/2001/12/DOM-Level-2-issues
http://www.w3.org/TR/DOM-Level-2-HTML/html.html

KC-Luck
11-28-2005, 06:01 PM
use


//rbtn1.checked='checked';
//rbtn1.checked;
//rbtn1.checked='true';

rbtn1.checked = true; // a boolean value



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum