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 9234035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:41:42+00:00 2026-06-18T06:41:42+00:00

I have two HTML pages: form.html and display.html. In form.html, there is a form:

  • 0

I have two HTML pages: form.html and display.html. In form.html, there is a form:

<form action="display.html">
    <input type="text" name="serialNumber" />
    <input type="submit" value="Submit" />
</form>

The form data is sent to display.html. I want to display and use the form data serialNumber in display.html, as shown below:

<body>
    <div id="write">
        <p>The serial number is: </p>
    </div>
    <script>
    function show() {
        document.getElementById("write").innerHTML = serialNumber;
    }
    </script>
</body>

So how can I pass the serialNumber variable from form.html to display.html so that the above code in display.html will show the serial number and the JavaScript function show() gets the serialNumber from the first HTML?

  • 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-06-18T06:41:43+00:00Added an answer on June 18, 2026 at 6:41 am

    If you have no option to use server-side programming, such as PHP, you could use the query string, or GET parameters.

    In the form, add a method="GET" attribute:

    <form action="display.html" method="GET">
        <input type="text" name="serialNumber" />
        <input type="submit" value="Submit" />
    </form>
    

    When they submit this form, the user will be directed to an address which includes the serialNumber value as a parameter. Something like:

    http://www.example.com/display.html?serialNumber=XYZ
    

    You should then be able to parse the query string – which will contain the serialNumber parameter value – from JavaScript, using the window.location.search value:

    // from display.html
    document.getElementById("write").innerHTML = window.location.search; // you will have to parse
                                                                         // the query string to extract the
                                                                         // parameter you need
    

    See also JavaScript query string.


    The alternative is to store the values in cookies when the form is submit and read them out of the cookies again once the display.html page loads.

    See also How to use JavaScript to fill a form on another page.

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

Sidebar

Related Questions

Lets say there are two pages with two different html elements which have the
I have two pages in Jquery mobile(page1.html,page2.html,page1.js,page2.js). A form with dynamic list available in
I have two html pages on my webserver www.example.com/desktop.html www.example.com/mobile.html In principle the content
lets say i have two pages links.html & contents.php ... first page contains only
I have the exact same html sitting on two different servers. Both pages call
I have two text boxes t1 and t2 in an html page. I'd like
In my html page, I have one table, for every row there are two
I have an HTML page where there are two Textboxes and a Button. And
I have two pages; page1 and page2 . page1 holds a form while page2
I have a form with two integer-only text boxes, one group of radio buttons,

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.