i am trying to get to modify this script .
i have a form that returns the longditude and latitude from google map api.
I am trying to insert that data into a new form. With a lot of uyahoogling i made some progress but canyt nail this down or find clear directions where im going wrong.
so the original code is
g.geocode(address, function(data) {
if(data != null) {
olat = data.latitude;
olng = data.longitude;
$('#geocode-result').append("Latitude: " + olat + "<br />" + "Longitude: " + olng + "<br /><br />");
thats is fine that it appends to a div
so my modification is
$('<input>').attr({
type: 'text',
id: 'geocode-long',
value: olng
}).appendTo('form');
$('<input>').attr({
type: 'text',
id: 'geocode-lat',
value: olat
}).appendTo('form');
this kinda works but i want this to enter into a new form , not the existing form but i cannot find how to specify that. its frustrating but oi really cant find a reference to do that, im assuning its in the append to form but not sure how to be more specific.