/    Sign up×
Community /Pin to ProfileBookmark

Hello,

The code below assigns a value to the Latitude and to the Longitude table cells when the submit button is pressed.

I would like to have these values appear in text boxes instead. Obviously I need to amend onclick=”javascript:usePointFromPostcode(document.getElementById(‘postcode’).value, placeMarkerAtPoint)”

to make this work but I can’t seem to.

Assuming two text boxes with names lng and lat, how would I amend the line?

Thanks

[CODE] <p align=”left”>
<table bgcolor=”#FFFFCC” width=”300″>
<tr>
<td width=”100″>
<b>Latitude</b></td>

<td id=”lat”>
</td>
</tr>
<tr>
<td width=”100″>
<b>Longitude</b></td>
<td id=”lng”>
</td>

</tr>
</table>
</p>
<p>
Postcode:
<input type=”text” id=”postcode” size=”10″ value=”IG3 8PY” /><br />
<input type=”submit” value=”Find” onclick=”javascript:usePointFromPostcode(document.getElementById(‘postcode’).value, placeMarkerAtPoint)” /><br />
<div id=”map” style=”width: 500px; height: 500px”>
</div>

<p>

<script src=”http://maps.google.com/maps?file=api&amp;v=2.x&amp;key=ABQIAAAA43oi4HUU6ay_KI5aLlgqqxRs1CMn3rnBr6PSR_9LSokba_k_xRRX9T_bJ1PRZQ_1n4nF3EOK”
type=”text/javascript”></script>

<br />

<script src=”http://www.google.com/uds/api?file=uds.js&#038;v=1.0&#038;key=ABQIAAAA43oi4HUU6ay_KI5aLlgqqxRs1CMn3rnBr6PSR_9LSokba_k_xRRX9T_bJ1PRZQ_1n4nF3EOK”
type=”text/javascript”></script>

<br />

<script src=”gmap.js” type=”text/javascript”></script>

</p>
</body>
</html>[/CODE]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@KorNov 11.2011 — Change the type of the button from type="submit" into type="button". And remove the useless [B][COLOR="Red"]javascript:[/COLOR][/B] token. Where did you learn [I]that[/I]?
<i>
</i>&lt;input type="button" value="Find" onclick="usePointFromPostcode(document.getElementById('postcode').value, placeMarkerAtPoint)" /&gt;
×

Success!

Help @davidwhite spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...