Web Analytics Made Easy -
StatCounter problems with drop down menu /w description - CodingForum

Announcement

Collapse
No announcement yet.

problems with drop down menu /w description

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • problems with drop down menu /w description

    If I have more then 4 options in the description stops working... I need to put many options in it as I am a newbie at this.. our course didn't teach us ... except for to look on the web and find code to use Can you help?? Thank you

    <form name="a294" >
    <select name="a969" size="1" style="background-color:#FFFFD7" onChange="displaydesc(document.a294.a969.selectedIndex)">
    <option selected value="bitscsa.html">Computer Software Applications</option>
    <option value="bitsapic.html">APICS Certification Program </option>
    <option value="bitslift.html">Fork Lift Training</option>
    <option value="bitsplca.html">Programmable Logic Controller Applications</option>
    <option value="bitsseap.html">Self Employment Assistance Program</option>
    <option value="bitstbo.html">Team Building Program for Organizations</option>
    <option value="bitswhmis.html">Workplace Hazardous Material Information System (WHIMS)</option>
    <option value="bitsfapc.html">Fire Alarm & Protection Certification Program</option>
    <option value="bitsplca.html">Programmable Logic Controller Applications</option>
    <option value="bitsseap.html">Self Employment Assistance Program</option>
    </select>
    <input type="button" value="Go" onClick="location=document.a294.a969.options[document.a294.a969.selectedIndex].value"><br>
    <span id="descriptions" align="left" style="font:italic 13px Arial">
    </span>
    </form>
    <script>
    //Drop down menu w/ description- © Dynamic Drive (www.dynamicdrive.com)
    //For full source code, 100's more DHTML scripts, and TOS,
    //visit http://www.dynamicdrive.com
    //CUSTOMIZE TEXT DESCRIPTIONS FOR LINKS ABOVE
    var textdisplay=new Array()
    textdisplay[0]="Brockville Only"
    textdisplay[1]="Brockville & Cornwall Only"
    textdisplay[2]="Brockville & Cornwall only"
    textdisplay[3]="Cornwall only (Fast Track)"
    textdisplay[4]="Cornwall only"
    textdisplay[5]="Brockville & Cornwall Only"
    textdisplay[6]="Brockville & Cornwall only"
    textdisplay[7]="Cornwall only (Fast Track)"
    textdisplay[8]="Cornwall only"

    function displaydesc(which){
    if (document.all)
    descriptions.innerHTML=textdisplay[which]
    else if (document.getElementById)
    document.getElementById("descriptions").innerHTML=textdisplay[which]
    }
    displaydesc(document.a294.a969.selectedIndex)
    document.a294.a969.options[0].selected=true
    </script>
    Last edited by Freddi; Jun 19, 2002, 12:12 PM.

  • #2
    hi,
    i see that you have 10 option items but only 9 textdisplays. make sure to have one for each corresponding items.

    Comment


    • #3
      Thanks but it quits working the as soon as there are more then 4 descriptions... if I only have 4 it shows the rest as undefined.. but as soon as I try for more then 4 the description doesn't show...



      Freddi

      Comment

      Working...
      X