Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to post global variable to the netx page

Status
Not open for further replies.

rosma197x

Technical User
Dec 10, 2007
2
IT
Hi,
I have page1 where I store some user selection in a global variables.
I want to post those variables to page2 which is linked to page1.
I would need in page2 those variable already set.

Here a simplified example:

// Start Page1

<html>
<body>

<script type="text/javascript">
alpha="Hello, world!";

function callback_btSet(h)
{
window.value = document.getElementById('ebId').value;
}

function callback_btGet(h)
{
alert(window.value);
}

</script>

<a target="_parent" href="page2.html" >page 2</a>
<p>&nbsp;</p>

<input name="ebId" value="" id="ebId" type="text">
<input name="btSet" id="btSet" onclick="javascript: callback_btSet(this);" value="Set" type="button">
<input name="btGet" id="btGet" onclick="javascript: callback_btGet(this);" value="Get" type="button">

</body>
</html>

// End Page1


// Start page2

<html>
<body>

<script type="text/javascript">

function callback_btGet(h)
{
alert(window.value);
}

</script>

<a target="_parent" href="page1.html" >page 1</a>
<p>&nbsp;</p>
<input name="btGet" id="btGet" onclick="javascript: callback_btGet(this);" value="Get" type="button">

</body>
</html>

// End page 2



many thanks,
rosma197x
 
Thanks to all.
I think I will go querystring as first try.
I was not aware about this javescript feature.

rosma197x
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top