Excellent - thanks - will give it a go. On Mar 15, 5:21 pm, Brak <[email protected]> wrote: > I noticed you are attaching the event javascript to an onclick > attribute on your button, then passing your marker object as a > concatenated string into the saveData function. There's a few problems > with this. Firstly, you should be using DOM event listeners instead of > old-world events attached via element attributes. Secondly, by passing > your marker object as a string, the code can't tell what it is. It > would be better to add an event listener to the form's 'onSubmit' > event, then bind the marker object to 'this' so you can refer to it > more easily in your saveData function. This method also allows you to > consolidate all your javascript into one place, instead of having it > embedded inside your HTML and strings. > > On Mar 9, 1:42 pm, kathb4 <[email protected]> wrote: > > > I almost have this but not quite. Being a newbie I think I am lost in > > my objects, arrays and globals in V3. > > > I can place a marker on the map with a double click. It then brings up > > an infowindow with a form, which, if you click save, the form params > > are passed to an ajax which inserts them into a db and prints them at > > the bottom of the page. All well and good. > > > But... > > Multiple markers are allowed/created. I think I am tracking them > > correctly as the infowindow displays the index number I have > > assigned. When a user submits the infowindow form I want the marker > > to change. > > > But I can't seem to pass the marker object through the form and back > > to the map such that I can change the marker.setIcon once the data has > > been saved. I can't pass the marker object via > > > <input type='button' value='Save & Close' onclick='saveData("+marker > > +")'/> > > > and the marker is not reachable as a global variable because if I set > > it as a global variable my infowindows always come up attached to the > > last marker inserted. > > >http://trees-2010-dev.test.www.nhm.ac.uk/test2.php > > > I think it has something to do with the markerArray but for the life > > of me I've surfed all day and can't figure it out - thanks so much for > > any help. > >
-- 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.
