please can you send me the complete code for this as its not clear as to
where to add this function. The initialize function has the google map
variable and when i call this it doesnt work.. i have tried to put var map
as the global variable too but still didnt work.. object not found error is
returned.. please can you help me out really desperate.


On Mon, Sep 20, 2010 at 5:30 PM, Martin <[email protected]> wrote:

> Hi.
>
> Try this.
> Create a valid HTML form:
>
> <form action="" onsubmit="myFunction(this); return false">
> <input type="text" name="lat" value="" maxlength="12" />
> <input type="text" name="lng" value="" maxlength="12" />
> <input type="submit" value="Go" />
> </form>
>
> function myFunction(myForm){
> // myForm is the form so you can access values like this:
> var lat=parseFloat(myForm.lat.value);
> var lng=parseFloat(myForm.lng.value);
> // so create your markers in this function and add them to the map
> }
>
> When the form submits, the 'return false' part of the onsubmit handler
> prevents the form from submitting to the server - a standard AJAX form
> you could say.
>
> If the form still submits then look for errors in myFunction(), an
> error which prevents the function from completing will also prevent
> the return false from being executed and that means the form will
> submit (to itself as the action attribute is empty) and the page will
> reload.
>
> Martin.
>
>
> On 20 Sep, 12:44, Mansoor <[email protected]> wrote:
> > Hi,
> >
> > I have a simple form that has two input fields for latitude and
> > longitude values respectively. I want to add markers on the google map
> > on the onClick event of submit button with the form. I should be able
> > to add as many markers as i can without refreshing or reloading the
> > map. I have tried my best out over the internet but in vain.. please
> > help.
> >
> > Regards.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-maps-js-api-v3%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to