Add group values to drop down menu

Hello, I have a drop down menu that is populated by the following javascript:

// Place holder
var AS_Airport = 
    {
    group :
        "Heathrow Airport",

    premise:
        "Flight Number (eg VS401 Dubai)",

    shortcuts :
        [           
            ["HEATHROW TERMINAL 1", "Heathrow Airport Terminal 1"],
	    ["HEATHROW TERMINAL 3", "Heathrow Airport Terminal 3"],
	    ["HEATHROW TERMINAL 4", "Heathrow Airport Terminal 4"],
	    ["HEATHROW TERMINAL 5", "Heathrow Airport Terminal 5"]
        ]



	};

var AddressShortcuts = [AS_Airport];

The drop down category is Heathrow Airport. When that is selected another drop loads the shortcuts (Terminal 1, Terminal 3 etc).

what i would like to do is add another selection with another set of shortcuts to the above but am unsure how to do it.

for example i have tried the following without success:

// Place holder
var AS_Airport = 
    {
    group :
        "Heathrow Airport",

    premise:
        "Flight Number (eg VS401 Dubai)",

    shortcuts :
        [           
            ["HEATHROW TERMINAL 1", "Heathrow Airport Terminal 1"],
	    ["HEATHROW TERMINAL 3", "Heathrow Airport Terminal 3"],
	    ["HEATHROW TERMINAL 4", "Heathrow Airport Terminal 4"],
	    ["HEATHROW TERMINAL 5", "Heathrow Airport Terminal 5"]
        ]


group :
        "Heathrow Hotels",

    premise:
        "Room Number",

    shortcuts :
        [           
            ["EDWARDIAN LHR", "Heathrow Raddisson Edwardian Hotel"],
	    ["SOFITEL LHR", "Sofitel Hotel, Heathrow Terminal 5"]
        ]


	};

var AddressShortcuts = [AS_Airport];

when i use the code above to try and add another group and set of values it doesn’t add any of the groups. if someone could please let me know the correct way to add a group to the above i think it will work fine.

thanks

i think that is the next step. if i can get a piece of code that theoretically should work i can test it. if the code doesnt work then there is probably more to it then i think and i will upload the rest of the code.

any more suggestions on this?

Sorry, I wish my JS were better… hopefully a guru will show up.

Possibly someone will ask you what your actual script itself is, and what the HTML is that it’s interacting with (your form).

I wonder if it’s to do with you having two names (group) with different values (one is airport and one is hotels).


var AS = {
   Airports : {
     group :
        "Heathrow Airport",

      premise:
        "Flight Number (eg VS401 Dubai)",

      shortcuts :
        [           
            ["HEATHROW TERMINAL 1", "Heathrow Airport Terminal 1"],
	    ["HEATHROW TERMINAL 3", "Heathrow Airport Terminal 3"],
	    ["HEATHROW TERMINAL 4", "Heathrow Airport Terminal 4"],
	    ["HEATHROW TERMINAL 5", "Heathrow Airport Terminal 5"]
        ]
     },

  Hotels : {
    group :
        "Heathrow Hotels",

      premise:
        "Room Number",

      shortcuts :
        [           
            ["EDWARDIAN LHR", "Heathrow Raddisson Edwardian Hotel"],
	    ["SOFITEL LHR", "Sofitel Hotel, Heathrow Terminal 5"]
        ]
      }
};

I don’t know that this is correct syntax (likely isn’t), but you want to add more name-value pairs using the same names, so I figured you need them differentiated somehow (by something other than order). So now I’ve attempted two groups: Airports and Hotels. Each has their own group, premise and shortcuts.

I suppose I could check my syntax by reasing the JSON pages, but I’m about to go get tasty tasty foods (lunchtime).

hi thanks for the reply. using the code you gave me the main drop down menu still does not display either ‘Heathrow Airport’ or ‘Heathrow Hotel’ as a main option.

i should also mention that code is not causing any errors in the form (ie with an extra ’ or ;). it is working fine but just not showing the above.

thanks