Your code is correct for list boxes. For radio button group you need to loop through them and pick the checked one.
Code:
function getRadioFromGroup(GroupName)
var colButtons = document.getElementsByName(GroupName)
for (var i = 0; i < colButtons.length; i++)
{
if (colButtons[i].checked) return colButtons[i];
}
return null;
}
//Function to call from empsearchbutton
onclick="showValue(getRadioFromGroup('search_emptype'));
To show value immediately as you want then change your onclick to:
Code:
onclick="showValue(this);"
in your buttons and have showValue as:
Code:
function showValue(Button)
{
if (Button)
{
document.searchempform.text1.value = Button.value;
}
}
--
Joe