certainly....
// returns the array number of the selected radio button or -1 if no button is selected
function getSelectedRadio(buttonGroup) {
// if the button group is an array (one button is not an array)
if (buttonGroup[0])
{
for (var i=0; i<buttonGroup.length; i++)
{
if (buttonGroup.checked)
{
alert(i);
return i
}
}
}
else
{
// if the one button is checked, return zero
if (buttonGroup.checked)
{
alert(0);
return 0;
}
}
// no radio button is selected
alert("You must select the radio control of the record to edit.");
return -1;
}
I need to validate the data prior to the submit, otherwise I wouldn't bother. BTW, my thinking is to set the index to a $_SESSION var and then post the form. Can I do that ?