bluewalrus
09-23-2009, 06:57 PM
How can I have javascript send it's value in a form
I have this form:
<form method="post" action="submit.php">
Name:<input type="text" name="name" /><br />
City:<input type="text" name="city" id="city"/><br />
State:<input type="text" name="state" id=state" /><br />
Address:<input type="text" name="address" id="address" /><br />
Phone:<input type="text" name="phone" /><br />
<input type="hidden" name="latlong" value="???" /><br />
<input type="submit" onClick="javascript:submitdata();" />
</form>
and I want the address, city, and state to go into the var address I then want the output of that which is point to be passed in the latlong value.
This is my idea of how it might function but I'm not sure cause I don't know javascript. Hope someone here can help me out.
var address = "document.submitform.address.value + /", /" + document.submitform.city.value/" + /", /" + document.submitform.state.value";
geocoder.getLocations(address, locate);
function locate(response)
{
place = response.Placemark[0];
point = new GLatLng(place.Point.coordinates[1],
place.Point.coordinates[0]);
This is what I expect address to equal with this address, city, state
I have this form:
<form method="post" action="submit.php">
Name:<input type="text" name="name" /><br />
City:<input type="text" name="city" id="city"/><br />
State:<input type="text" name="state" id=state" /><br />
Address:<input type="text" name="address" id="address" /><br />
Phone:<input type="text" name="phone" /><br />
<input type="hidden" name="latlong" value="???" /><br />
<input type="submit" onClick="javascript:submitdata();" />
</form>
and I want the address, city, and state to go into the var address I then want the output of that which is point to be passed in the latlong value.
This is my idea of how it might function but I'm not sure cause I don't know javascript. Hope someone here can help me out.
var address = "document.submitform.address.value + /", /" + document.submitform.city.value/" + /", /" + document.submitform.state.value";
geocoder.getLocations(address, locate);
function locate(response)
{
place = response.Placemark[0];
point = new GLatLng(place.Point.coordinates[1],
place.Point.coordinates[0]);
This is what I expect address to equal with this address, city, state