0

The index page of the site will ask user to select a stage area. I want to pass their selection from page to page until they log out or return to this selection. I have searched long and hard but just don't know how to phrase that question to a web search. Just need a little push in the right direction. Form code below and thanks in advance.

<form name="pick" method="POST" action="http://wavepick.htm">
<table border="0">
  <tr VALIGN="TOP">
    <td width="177">

<select id="stageChoice" name="stageArea">
<option selected value=" ">(Select Staging Area)</option>
<option value="A">A </option>
<option value="B">B </option>
</select> 
</div>
<input type="submit" name="Submit" value="Stage" name="B1">
<input type="hidden" name="request_id" value="wavepick">
</form>

3 Answers3

0

If you are using a backend language such as PHP you can store that value in a $_SESSION variable. and access it wherever you need during that session.

Here is the documentation for the session variables:

PHP Session

If not, let me know and i'll figure out a different method for you.

DJ22T
  • 1,628
  • 3
  • 34
  • 66
0

You can store the selected value between pages in a session variable.

Jardo
  • 1,939
  • 2
  • 25
  • 45
0

If you want to do this only with HMTL/Javascript, you have to submit this form via "GET" (instead "POST"), and at each page you need to send again "stageArea" to the another page, so:

  • Page1.html?stageArea=B
  • Page2.html?stageArea=B
  • Page3.html?stageArea=B

That's how you read GET parameters via Javascript: How can I get query string values in JavaScript?

Ya, it's very arduous just with HTML/Javscript.

But you have mentioned "log out", do you have back-end (like PHP, ASP.NET,etc..)? With back-end language it'll be much more easier, you could store stageArea on session once, and just read it at each page.

Community
  • 1
  • 1
Wagner Leonardi
  • 4,226
  • 2
  • 35
  • 41