i need a solution.. i want to transfer a numeric value from a combo.. according to value with ajax/javascript i want to create radio button.. suppose i send 3 then , it will show 3 radio button.. plz help me... here is the javacript code


function radio_b(){

		var a=document.getElementById("radio_button").value;
for(i=0;i<a;i++){	

document.getElementById("rent_error").innerHTML="<input type='radio' value='V1' checked name='R1'>
<font color='Red'>Radio</font>"; 
}function radio_b(){

		var a=document.getElementById("radio_button").value;
for(i=0;i<a;i++){	

document.getElementById("rent_error").innerHTML="<input type='radio' value='V1' checked name='R1'>
<font color='Red'>Radio</font>"; 
}

Well if you're basing the creation on AJAX calls then you'd probably want to use a bit of DHTML instead of manipulating the innerHTML property, ie.,

function addRadio(parentID, radioID,radioName,innertext,color)
{
    parent = document.getElementById(parentID);
    newRadio = document.createElement('input');
    newRadio.type = 'radio';
    newRadio.id = radioID;
    newRadio.name = radioName;
    parent.appendChild(newRadio);
    newtext = document.createElement('span');
    newtext.style.color = color;
    newRadio.appendChild(newtext);
    newtext.text = innertext;
}
commented: Nice work +7
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.