Query String Problem!!! Heeelppp

liunx

Guest
Hi all <br />
<br />
i have a problem!<br />
<br />
i have a link in a HTML document. Now the HTML document is being built in an EmailMerge package.<br />
<br />
It looks like:<br />
<br />
"<A Href=http://www.htmlforums.com/archive/index.php/"http://www.anywhere.com/test/test.asp?id=[[ID]]&Event=[[Event]]>Click Here</a> To Show Interest<br />
<br />
[[Event]] & [[ID]] are values generated from a data source.<br />
<br />
Now here is the problem: if my event is like this:<br />
<br />
WC2002<br />
<br />
Then the code is fine.<br />
<br />
But if it is like this:<br />
<br />
World Cup 2002<br />
<br />
My event parameter on picks up the first word, which as you can see in this case is World. How do i make sure it picks up the whole lot. I know how to do it in ASP but this is just a plain HTML Email so i cant use server.URLEncode() to sort it out.<br />
<br />
Please help, i need to find a solution fast!!<br />
<br />
Thanks in advance!<br />
<br />
Roberto<!--content-->you will have to put %20 in the spaces between each word.<br />
<br />
World%20Cup%202002<!--content-->As Scoutt says, you should escape the string.<br />
<br />
<br />
<script language="Javascript"><br />
var x = escape("Mary had a little lamb") // "Mary%20had%20a%20little%20lamb"<br />
var y = unescape("Mary%20had%20a%20little%20lamb") // "Mary had a little lamb"<br />
</script><br />
<br />
<br />
Can you alter the email merge package to escape the string?<br />
The query string is exposed as window.location.search, so you'd have to manipulate this.<!--content-->Hi Jon,<br />
<br />
thanks for the help, it worked as it escaped my string. But i need to know how i would get that into a link.<br />
<br />
i need to build the link:<br />
<br />
<a href=http://www.htmlforums.com/archive/index.php/"http://www.anywhere.com/test.asp?event=World%20Cup">Here</a><br />
<br />
i need some advice as i am not the best Java programmer.<br />
<br />
Thanks in advance<br />
<br />
Roberto<!--content-->are they in a database? because that is where you need to put them. you say that [[Event]] & [[ID]] are values generated from a data source, so where is that datasource?<br />
<br />
somewhere you ahve the words "World Cup 2002" you need to start there.<!--content-->Hi Scoutt,<br />
<br />
Yes both [[ID]] and [[Event]] are in a database table, but i do not want to change these values in my database as i need them to stay intact for reporting later on.<br />
<br />
Have you got any suggestions, i have tried to create a function which works but then i try and return the value and it is wrong. It is not the value that is wrong, but i have event="JavaScript:makeURL('World Cup 2002')" and it returns - event=JavaScript:makeURL('World%20Cup%202002')!?? <br />
<br />
function makeURL(st)<br />
{<br />
<br />
var x = escape(st);<br />
<br />
return (x);<br />
<br />
}<br />
<br />
i dont know how i could or even if you can build a URL with the value that is passed back from the function.<br />
<br />
Please help, <br />
<br />
Roberto<!--content-->
 
Back
Top