On Jul 3, 1:36 pm, Lee <[email protected]> wrote:
>
> Help will be so appreciated

Please don't post code. Please don't do it twice!

I suggest

<select id="travelMode" name="travelMode">
    <option value="G_TRAVEL_MODE_DRIVING" selected>By Car</option>
    <option value="G_TRAVEL_MODE_WALKING">Walking</option>
</select>

then change this

         if(document.form.travelMode.selectedIndex == 0){
                walkingDriving.travelMode=G_TRAVEL_MODE_WALKING;}

into

walkingDriving.travelMode=eval(document.getElementById
("travelMode").value);

Note the use of eval() to evaluate the string it's given and get the
real value. You may still have problems because using field-names as
properties of forms (like "this.from.value") isn't standard
Javascript. Using document.getElementById() is.

However: Rossko is right and this is NOT a maps question. It's a DHTML
question about how to pass values from <select> elements into
Javascript code.

Andrew
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to