Results 1 to 1 of 1

Thread: Combo Box

  1. #1
    Join Date
    Jan 2011
    Thanked 0 Times in 0 Posts

    Default Combo Box

    Hello all

    I'm trying to do a triple combo box with descriptions and found this code below on internet:
    I'm trying to learn javascript.. but I don't know much. I couldn't change this javascript to 3 combo boxes. I'm trying to make boxes with Maker, Car Model and Year. If possible, when the user hit GO, to the show the description into a div, and do not go to a website.

    <form name="doublecombo">
    <select name="example" size="1" onChange="redirect(this.options.selectedIndex); displaydesc()">
    <option>SimplytheBest Shareware</option>
    <option>SimplytheBest Affiliates</option>
    <option>SimplytheBest Metasearch</option>
    <select name="stage2" size="1" onchange="displaydesc()">
    <option value="">Index</option>
    <option value="">Business</option>
    <option value="">Graphics</option>
    <input type="button" name="test" value="Go!"
    <br />
    <input type="text" name="txtdisplay">
    <!--// Orignal Scripts:
    ////// Double Combo Script By Website Abstraction (
    ////// Drop down menu w/ description by Dynamic Drive (
    var groups=document.doublecombo.example.options.length
    var group=new Array(groups)
    var descr=new Array(groups)
    for (i=0; i<groups; i++){
    group[i]=new Array()
    descr[i]=new Array()
    group[0][0]= new Option("Index","")
    descr[0][0]= "Index description";
    group[0][1]= new Option("Business","")
    descr[0][1]= "Business description";
    group[0][2]= new Option("Graphics","")
    descr[0][2]= "Graphics description";
    group[1][0]=new Option("Art and Photo","")
    descr[1][0]= "Art and Photo description";
    group[1][1]=new Option("Books","")
    descr[1][1]= "Books description";
    group[1][2]=new Option("Clothing","")
    descr[1][2]= "Clothing description";
    group[2][0]=new Option("Web Search","")
    descr[2][0]= "Web Search description";
    group[2][1]=new Option("Auctions Search","")
    descr[2][1]= "Auctions Search description";
    group[2][2]=new Option("MP3 Search","")
    descr[2][2]= "MP3 Search description";
    group[2][3]=new Option("Job Search","")
    descr[2][3]= "Job Search description";
    var temp=document.doublecombo.stage2
    function redirect(x){
    for (m=temp.options.length-1;m>0;m--)
    for (i=0;i<group[x].length;i++){
    temp.options[i]=new Option(group[x][i].text,group[x][i].value)
    function go(){
    function displaydesc(){
    var desc=descr[document.doublecombo.example.selectedIndex][document.doublecombo.stage2.selectedIndex];
    Last edited by jscheuer1; 01-23-2011 at 02:36 AM. Reason: format code, # instead of quote


Posting Permissions

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