Radio button group

A

ahixon2112

I have a form that contains two radio buttons each with a drop down
list attached. As the form loads, I have the following javascript that
runs after the drop down lists populate with items from a database:

<script language="javascript">
this.form.ManagementCheck[0].checked=false;
this.form.ManagementCheck[1].checked=false;
if (this.form['Manager'].selectedIndex != 0)
{this.form.ManagementCheck[0].checked=true};
if (this.form['Director'].selectedIndex != 0)
{this.form.ManagementCheck[1].checked=true};
</script>

I also have some code up above this (ColdFusion) that sets one of the
list items to selected if that particular field is populated in the
database and matches an item from the list. So, I would like for the
radio button that's beside it's respective drop down list to become
checked if the selectedIndex of that list is not 0, but I can't get it
to be consistent. Once a radio button is selected, it will not change
no matter which list has an item selected.

Any thoughts?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top