0
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>"; 
}
2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by ShawnCplus
1

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;
}
Votes + Comments
Nice work
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.