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

  • Home
  • SEARCH
  • 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 6179117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:35:45+00:00 2026-05-24T00:35:45+00:00

quick question here. Normally, using JQuery, if I want to pass the value from

  • 0

quick question here.

Normally, using JQuery, if I want to pass the value from an input box to another one on the same page, I`d just do something like this :

    <script type="text/javascript">

    $('#postalCodeBtn').live('click', function(){
    var text = $('#from1').val();
    $('#from').val(text);
    });

</script>

But now assuming the input “from1” is on a page called detail, and “from” is on another page called maps.

How can I pass the value between both pages ?

Thanks !

  • 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-24T00:35:46+00:00Added an answer on May 24, 2026 at 12:35 am

    If it’s not being loaded via AJAX, you’re going to have to send it to the server and use a server side language (php, python, etc.) to add it into maps. I suppose you could also save it to a cookie if you REALLY wanted to and then check for it on the “maps” page. You could also send it via GET (modify the link, if there is one) and then use JS to parse it but if it’s a form field that’s being POSTed, server side language it is.

    Edit: Well, without knowing more, this is the best I can do for you.

    <script type="text/javascript">
    
    function buildValue(sValue) {
        if (/^\s*$/.test(sValue)) { return(null); }
        if (/^(true|false)$/i.test(sValue)) { return(sValue.toLowerCase() === "true"); }
        if (isFinite(sValue)) { return(parseFloat(sValue)); }
        if (isFinite(Date.parse(sValue))) { return(new Date(sValue)); }
        return(sValue);
    }
    
    function getVars() {
        var oGetVars = {}
        if (window.location.search.length > 1) {
            var iCouple, aCouples = window.location.search.substr(1).split("&");
            for (var iCouplId = 0; iCouplId < aCouples.length; iCouplId++) {
                iCouple = aCouples[iCouplId].split("=");
                oGetVars[unescape(iCouple[0])] = iCouple.length > 1 ? buildValue(unescape(iCouple[1])) : null;
            }
        }
        return oGetVars;
    }
    
    $(function() {
        // The name of the parameter we're interested in
        var param = "postalCode";
    
        // Gets the params from the URL
        getParams = getVars();
        // If the parameter we want is in the URL AND the #from element is found...
        if (getParams[param] && $("#from").length) {
            // Set the value of the #from element to the value of the parameter
            $("#from").val(getParams[param])
        }
    
        // Store the postalBtn in a variable for easy access
        var postalBtn = $("postalCodeBtn");
    
        // If the postalBtn is on this page
        if (postalBtn.length) {
            // Create a flag to track modification of anchor
            var modifiedAnchor = false
    
            // Adds the GET parameter to the parent anchor on button click
            postalBtn.click(function() {
                // In case the user gets click happy
                if (modifiedAnchor) return;
    
                // Get the parent anchor DOM element
                var anchor = $(this).parent('a')[0]
    
                // Append the GET parameter to the anchor's href
                // (this assumes the anchor HREF doesn't have GET parameters already)
                anchor.href += "?" + param + "=" + encodeURIComponent($("#form1").val())
    
                // Set our modifiedAnchor flag to true
                modifiedAnchor = true
            }
        }
    })
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Quick question... I have an input box that upon key enter, adds the value
quick question here. I'm looking for a way to populate my JQuery search box,
quick question here. I'm wondering how to create a 2D vector from user input.
Another quick question here, I have this code: string sa[6] = { Fort Sumter,
Hopefully a quick question here. Can you use a function's returned value in a
Quick question here. I want to search a TextArea component (flex) to see if
Here's a quick question that's probably simpler than I'm thinking. I'm populating a jQuery
quick question.. I'm trying to make two variables appear in one text box but
James here. I have a quick question. I want to add a similar image
Quick question here, I'm using Visual Studio to create an Outlook add-in. I've created

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.