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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you pass # through query string!

Status
Not open for further replies.

JohnPham

Programmer
Jul 9, 2001
34
US
Hi,

Anyone please help me with this: I try to pass this query string through URL but seem not work for me.

If my initial string is: initPIN = "12345#678"
when I pass through URL like this:
<script language=&quot;javascript&quot;>
function Openweb(initFlg){
Myweb = Myweb.asp?PIN=&quot; + initPIN + &quot;&initState=&quot; + initFlg;
Myweb = window.open (Myweb, &quot;Myweb&quot;, &quot;scrollbars=1, resizable=1&quot;);
}

On the ASP server site, when I use
request.querystring(&quot;PIN&quot;) is just comes back with value 12345. The rest has been cut off.
Is there any way to prevent this situation.

Thanks all for help.

John
 
change
If my initial string is: initPIN = &quot;12345#678&quot;
to
If my initial string is: initPIN = &quot;12345\u0023678&quot;

\u0023 is the unicode
 
i tried the escape function before, for some reason.... it never work for me. then i decided to replace it with other special character that you can be very sure that those sequence will never appear in your original string.
such as # = &quot;!@#$%^&quot;
then in the receiving end, just find &quot;!@#$%^&quot; and replace it with # :p
 
do you know where the # will appear in the value?
if you do try breaking the string

myvar = &quot;#&quot;;
var wer = &quot;12345&quot; + myvar + &quot;6758&quot;;

In a post some time back somebody suggested using
\u0023 instead of # and it seemed to work fine
 
if i am not wrong, special character like '?' and '&' will cause problem also. that's why i use the replacing method rather than other method.
 
Thanks everyone for input. I will try all the possible cases suggestion above.

Thank you,

John
 
Hi All,

I just try escape(initPIN) and it seems to work fine with me.

Thanks everyone for help.


John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top