-----Original Message-----
From: Robert Orlini [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 25, 2004 9:56 AM
To: CF-Talk
Subject: OT: Radio button check

>  How do I check whether a certain value is checked off on a radio button?

>  The group name is "send". The value I want checked is whether it is
"sendemail". If it is I want
> an alert to ask that the subject is required.  


I usually do something like this.  Since radio buttons don't have the
selectedIndex property, you have to look through the group to find out what
was selected.


var val;

for (var x = 0; x < formname.send.length; x++)
{
    if (formname.send[x].checked)
    {
        val = formname.send[x].value;
        break;
    }
}

if (val == 'sendemail')
    alert('please provide a subject');
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to