Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 27th, 2016, 09:05 AM
Authorized User
Points: 483, Level: 7
Points: 483, Level: 7 Points: 483, Level: 7 Points: 483, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2007
Location: Edgewood, NY, USA.
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default capture variable in a form field

Hi.
I need to get the results of the latitude and longitude to appear in the form field as well.

cant figure it out!

code:
<html>
<head>
<script>
function showlocation() {
// One-shot position request.
navigator.geolocation.getCurrentPosition(callback) ;
}

function callback(position) {
document.getElementById('latitude').innerHTML = position.coords.latitude;
document.getElementById('longitude').innerHTML = position.coords.longitude;
}
</script>
</head>
<body onload="javascript:showlocation()" >

Latitude: <span id="latitude"></span> <br/>

Longitude: <span id="longitude"></span>
<%=test%>
<form>
<input type="text" name="latitude" id="lattitude" value=""/>
<input type="text" name="longitude" id="longitude" value=""/>
</form>

</body>
</html>

THANX!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Move form from table field into variable to run form AnninCT BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 0 April 17th, 2010 11:17 AM
help with passing a variable from a form field via url Igor Astakhov BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 2 March 10th, 2009 02:00 PM
Select a field on a form, based on variable JAnthony Access VBA 2 April 17th, 2006 11:16 AM
capture variable in URL Lemonluv07 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 March 31st, 2006 03:00 AM
capture a variable from url. .com?jblp jblp PHP How-To 1 October 25th, 2004 07:26 PM



All times are GMT -4. The time now is 10:20 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.