Hi,
I am using the v5 menu system and I want to pass a description from a product page to a quote page so the user does not have to retype the product description. I have looked at options using "cgi" and "asp" but I have seen an example using "js" with "var=url" in the first page setting the variable with the required data and then using "location.search" in the second page to pick up the data.
Code Goes like this;
Sending Program:
<head>
var url = 'www.im-press.co.uk/quick_quote.htm?subj ... d%20Badges'
</head>
<body>
<A HREF="javascript:NewWindow('url','Quote','450','450','no')">
Receiving Program:
<% descript=Request.QueryString( "subject") %>
<html>
<head>
<body>
<p>Thanks for your interest in <B><%=descript%></B>.<BR>
I have tried different variations but so far have failed, my "js" is not good so does anyone know if (a) is this possible with the menu system or (b) is there a better way?
Regards
Ian
Moving data between pages
The example you used uses ASP, which you said you are not using. Try this function in the receiving page. Say you have a link in the menu, page.html?something1=value1&something2=value2
Put this in the HEAD of your document
In the receiving page, to get the value1 that was set to something1, and you want to display value1, you'd say...
Good luck.
Put this in the HEAD of your document
Code: Select all
<SCRIPT>
function getKeys()
{
var keys = new Object();
var queryString = location.search.substring(1);
var keyPairs = queryString.split("&");
for(var i = 0; i < keyPairs.length; i++)
{
var position = keyPairs[i].indexOf('=');
if (position == -1) continue;
var keyname = keyPairs[i].substring(0, position );
var keyvalue = keyPairs[i].substring(position + 1);
keys[keyname] = unescape(keyvalue);
}
return keys;
} </SCRIPT>
Code: Select all
<td>
Thanks for your interest in <span id="interestedItem"></span>
<SCRIPT>
queryKeys = getKeys();
document.all["interestedItem"].innerHTML = queryKeys["something1"];
</SCRIPT>
</td>
Dave Hergert
Software Engineer
"Helping to make the menu better, one at a time."
Software Engineer
"Helping to make the menu better, one at a time."