[thelist] ASP: help with forms and ampersand

aardvark roselli at earthlink.net
Sat Oct 21 23:38:40 CDT 2000


> From: "Warden, Matt" <mwarden at odyssey-design.com>
> 
> However, the *easiest* thing for you to do is to just use JS's escape()
> function around your values when you pass-along those form values:
> 
> url += "?myvar=" + escape(document.form.element.value);
> 
> escape() is similar to Server.URLEncode (I think the only difference is that
> it encodes spaces as +'s instead of the correct %20).

<tip type="ASP">
Depending on your user base, and how much traffic your scripts 
get, you may wish to run a replace function on the 
Server.URLEncode in ASP. Since it encodes spaces as '+' instead 
of '%20', doing the following may alleviate some (but definitely not 
all) of your problems:
    Replace(Server.URLEncode(foo),"+","%20")
</tip>




More information about the thelist mailing list