I am trying to create a function that will access the value of different option boxes. When I call the function I want to pass in the name of the option box and then access its properties. Can anyone help? Here is something like what I am doing:
function viewReport(name){
if(eval("document.rptselt.name.options[document.rptselt.name.selectedIndex].value==''"){
alert('Please select one option to view report');
}
else{
eval('document.rptselt.rpt.rptparm.value=document.rptselt.name.options[document.rptselt.name.selectedIndex].value');
window.open('/work/report/report.pl?rptparm='+document.rptselt.rptparm.value,'Report','scrollbars=yes,resizable=yes');
}
}//end function
Thanks