Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7687857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:47:37+00:00 2026-05-31T19:47:37+00:00

I’m making a web-app with PhoneGap. Here’s my current hurdle: On page one, the

  • 0

I’m making a web-app with PhoneGap. Here’s my current hurdle:

On page one, the user chooses a latitude and longitude, then hits continue. With some nice GET action on the form and a javascript URL parser on the next page, the next page thus is passed the lat and lng coordinates. On this new page, the user is asked to input a radius. Via the same method, the radius is passed on to the final page, which displays a google map with a circle on it made from the coordinates and the radius.

But the problem is that when I pass the radius on to the final page, it obviously only passes the radius. How can I pass the lat and lng onwards from the second page, which aren’t part of form information? They’re already established. I know the obvious solution is to put all three variables on one page, but for foolish reasons beyond my control it needs to be this way.

So the question stands: how do you pass information that exists as a variable in javascript on to the next page? It’s not part of a form. Just a variable.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:47:37+00:00Added an answer on May 31, 2026 at 7:47 pm

    All you need to do is add a couple hidden input elements to the form (<input type="hidden" />).

    This can be done many ways. The shortest is to use a library (example code happens to be jQuery):

    $('<input type="hidden" name="lat" />').val(latitudeValue).appendTo(formSelector);
    $('<input type="hidden" name="lng" />').val(longitudeValue).appendTo(formSelector);
    

    Raw JS is a bit longer, but not particularly complicated:

    //I haven't checked this, so some cross-browser tweaking might be necessary
    var lat,
        lng,
        form;
    lat = document.createElement('input');
    lat.type = 'hidden';
    lat.value = latitudeValue;
    lng = document.createElement('input');
    lng.type = 'hidden';
    lng.value = longitudeValue;
    form = document.querySelector(formSelector);
    form.appendChild(lat);
    form.appendChild(lng);
    

    latitudeValue, longitudeValue, and formSelector are variables that you’d have to define in the context of your page. You might also use a different parameter name, such as name="longitude".


    It sounds like you really should be using AJAX to change the content of the page, so that you’re not making consecutive GET requests. Instead, you could simply be swapping out the main content of the page depending on which step in the process the user is on. It would remove the necessity to do any URL parsing (which is easy to do incorrectly).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.