How can I have javascript send it's value in a form
I have this 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.Code:<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>
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.
This is what I expect address to equal with this address, city, stateCode: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]);



Reply With Quote

Bookmarks