View Full Version : passing variables through two pages

12-21-2005, 05:58 PM
Hi all,

Is it possible to pass a value hidden from one page to the other on a href click in javascript?

I mean say, I am in listedit.aspx page that has this link,

<A ID=onetidListEdit9 target=_self HREF="savetmpl.aspx?List=%7B422F76E7%2DA68C%2D4E4D%2D8B0D%2D2999D918FD34%7D">Save document library as template</A>

(listedit.aspx Page URL is

clicking on this link takes me to the URL,


and in the listedit page(the firstpage), I have a TD

<TD class=ms-propertysheet>
<a id="onetidGoBack" href="/sites/kishoretestsite/Misc%20Docs/Forms/AllItems.aspx"> Go Back to "Docs Misc"</a>

so I need the data in this TD to follow to the next page in some hidden field or something so that I can use it in the next page. Mind you I am clicking on a href link (savetmpl.aspx) to go the next page,

with this script, I captured the exact portion I want,

var temp_listname = document.getElementById("onetidGoBack").innerHTML
var listname = temp_listname;
listname = listname.toString().split('to')[1];

from the above script listname will get the value as, "Docs Misc"

Now, all I need is to some how pass the listname variable to the next page(savetmpl.aspx) where I can use this variable to get the data I want and display it in the other page which is savetmpl.aspx.

This sounds kinda complicated for a scripting language, Can this be done in Javascript?? :(