Radio button group

Discussion in 'Javascript' started by ahixon2112, Apr 18, 2007.

  1. ahixon2112

    ahixon2112 Guest

    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?
     
    ahixon2112, Apr 18, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ken Saganowski

    Radio Button Group

    Ken Saganowski, Jan 23, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    610
    Alvin Bruney [MVP]
    Jan 25, 2004
  2. David Hearn
    Replies:
    0
    Views:
    623
    David Hearn
    Mar 4, 2005
  3. Replies:
    1
    Views:
    3,934
    John C. Bollinger
    Feb 24, 2006
  4. Scott D Johnson
    Replies:
    1
    Views:
    1,096
    Scott D Johnson
    Sep 27, 2006
  5. Hiten
    Replies:
    1
    Views:
    665
    Vidar Petursson
    May 26, 2004
Loading...

Share This Page