I have a function that changes which radio button is selected. I need to pass the form name to the
function but not the field name and am doing so like:
changeRadio(thi s.form);
The function:
changeRadio(for mname){
// I have skipped how the variable fieldname is created all that is important is that it needs to be
created in the function, not passed to it, thus the need (I think) for the following
var radio2check = eval(formname+' .'+fieldname); // Don't work
var radio2check = eval("document. actualformname. "+fieldname ); // Works
// later in the function the above is used like:
radio2check[0].checked = true;
}
So in other words, when I manually enter the form name in the eval part it works fine but when I use
the formname containing this.form passed into the function it don't work. I need to know how to
access the radio button by combining the formname passed into the function and the fieldname
variable created in the function.