Hi Mekala,
Can't you attach the method call to the onclick when the radio button is created dynamically?
If not, you could attach it when the onclick is executed - add the following to the start of your swap2()
Code:
function swap2(pRad) {
// attach hide function to other button if it exists
var f = pRad.form;
for(var i = 0; i < f.length; i++){
var el = f.elements[i];
if(el.name == pRad.name && el != pRad){
el.onclick = swap1;
break;
}
}
and change the first radio button to...
Code:
<input type="radio" name="radio" value="1" onclick="swap2(this)">
HTH,
Chris