Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2012
    South Florida
    Thanked 0 Times in 0 Posts

    Javascript to Show/hide drop down selections

    Hi everyone,

    I'm new here, I actually found this site by searching for the code I have a question for.

    I'm trying to show/hide different drop down selectors, depending on what is chosen in another drop down selector. I modified a script (I found here: http://www.codingforums.com/showthread.php?t=98406) in a way that I thought would work, but its not. Can anyone help me with what I'm doing wrong?

    Here is my page: http://www.leatherexpressonline.com/...er/testing.php

    Here is my javascript: http://pastie.org/3344253

    And my drop downs: http://pastie.org/3344258

    Also, I don't want the drop downs (ids: grade1000color, grade1500color, grade2000color, grade2500color, grade3000color, grade5000color) to be shown when the page is first loaded. Only when the correct option is chosen on the drop down. So I'm guessing I should add a display:none style to those drop downs, then have them shown on the javascript?

    Thanks so much for the help

  2. #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Thanked 665 Times in 660 Posts
    from what I can tell your first select box needs to have a function call in its onchange:
    <select name="Grade" id="choosegrade" onchange="ChangeDropdowns(this.value)">
    and yeah, the rest need style="display:hidden" or a similar css statement.

    the link you provided doesn't work


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts