Hey,
I've been trying to learn javascript for a few days. I'm a bit stuck!
I'd appreciate any links to get me going in the right direction or any advice I can get.
I've written a multidimensional array like this:
- var from_array = new Array();
-
-
from_array['Adelaide'] =
-
new Array ( "Alice Springs", "1.5", "2.8"); new Array ( "Amberley", "1.5", "2.8") ;
-
from_array['Canberra'] = new Array( "Adelaide", "1.5", "2.8" ); new Array ( "Alice Springs", "1.5",
-
-
"2.8");
I want to populate a select menu based on this. It should list Adelaide and Canberra. There is also the need for a 2nd select menu which I could write the array in a similiar way or possibly reuse that array.
So the HTML page will have: From <select menu 1> and To <select menu 2>
If a user selects Canberra and Adelaide on Go - I want it to return the value from the above array, which would be 1.5 if they select the first radio button or 2.8 if they select the 2nd radio button.
I'm assuming I need a function written and to call that function - not sure how to write it though.
Would appreciate any advice... I'm more a CSS monkey!