ed a wrote on 21 Nov 2003:
[color=blue]
> <script language="JavaScript" TYPE="text/javascript">[/color]
The language attribute isn't necessary.
[color=blue]
> function forceCompPay() {
>
> if (document.forms[1].groupType == "speaker") {
> document.forms[1].groupPayment[comp].checked = true
> }
> }[/color]
First, a few assumptions:
The name of the form is "register".*
The name of the delegate type radio buttons is "type".
The name of the payment type radio buttons is "payment".
The "speaker" delegate type is the first (index 0) button in "type".
The "no payment" payment type is the third (index 2) button in
"payment".
// If "speaker" is selected...
if (document.forms['register'].elements['type'][0].checked)
{
// ...set the payment type to "no payment"
document.forms['register'].elements['payment'][2].checked = true;
}
All you need to do is change the form name, radio button group names,
and the button indicies**.
Hope that helps.
Mike
* Using the form name is better than an index (easier maintenance).
** Despite the note above, you have no choice but to use the index.
--
Michael Winter
M.Winter@blueyonder.co.uk.invalid (remove ".invalid" to reply)