Maybe you should pass the same arguments given to your function to the
load method and take care of the whitespaces in the query string
function givedirections(street, where) {
...
directions.load("from: " + street + where + "-->whitespace to: ...
}
and - in every case - tell GDirections in which country to search
onclick="givedirections('Bahnstrasse', 'Frankfurt, de');">
On Nov 14, 6:41 pm, Taunus <[email protected]> wrote:
> Hi,
>
> I'm really desperately trying to do a route calculation with Google
> Maps and I'm absolutely stuck... My problem:
>
> In the HEAD, the following script is defined:
>
> function givedirections(strasse, ort) {
> directionsPanel = document.getElementById("my_textual_div");
> directions = new GDirections(map, directionsPanel);
> directions.load("from: " + street + ", " + place + " to: In den
> Eichen, Liederbach");
> }
>
> This works fine as long as I call it with a button like that from the
> BODY:
>
> <button onClick="givedirections('Bahnstrasse', 'Frankfurt');">Show !</
> button><br>
>
> But as I want to have users enter their start point with a form,
> NOTHING happens:
>
> <form action="#" onsubmit="givedirections(this.Strasse.value,
> this.Ort.value);">
> Street: <input name="Strasse" type="text">
> Town: <input name="Ort" type="text">
> <input type="submit" name="Submit" value="Show">
> </form>
>
> The same function is called, the same arguments are given to it, but
> still - it doesn't work. Why???
>
> Thanks and brgds
> Daniel
--
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=.