View Full Version : Need help passing js var to html form.

11-22-2012, 07:10 PM
Hi there everyone!

I'm trying to build a member map system using Google's js v3 api. I've built the page that allows a user to set their location, but I'm having problems figuring out how to then send that location as post data through a form.

Here is the page in question (http://husaberg.org/membermap/geolocateembed.php).

I need to store the latlong data for populating the map on another page, so it looks from the head code that I want the variable "marker". So I tried:

<input type='hidden' name='latlong' value='<script language="JavaScript">document.write(marker);</script>' />

But on submission, it's blank.

I'm searching on updating via onclick, but I'm just not savvy enough to figure it out.

I really have no idea how to handle this issue and am so in the dark that I'm not even really sure how to search for the resolution yet.

I would be eternally grateful if someone would help me get a successful passing of that marker variable.