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

Escape Sequences

Status
Not open for further replies.

bigairguy

Programmer
May 10, 2005
14
US
I have a webform with data that is passed to a popup window through a querystring. The popup window just displays the data from the original page in a printer-friendly format. However, the javascript will not execute to open the popup window if there are any data fields that have special characters such as ',?,!, etc. Based on research, I think that I need to pass an escape sequence to the querystring that will replace the special characters. I am trying to do one for an ampersand with the following code:

<script language="JavaScript" type="text/javascript" src="lib_popup.js"></script>

<%
FirstName = rsSelectGroup("FIRST_NAME")
AmpEsc = Replace(FirstName, &, &)

'(Last parameter is '&' followed by 'amp' and ';', so accordingly shows up as '&' in the forum)
%>

<center><a href="JavaScript://" onclick="win1=openNewWindow('PrintTransaction.asp?FirstName=<%=AmpEsc%>', 'saPrint', 600, 400, 'scrollbars,location,status,menubar,toolbar,resizable,status')">Printer-friendly version</a></center>


However, my code doesn't work, and I can't find a list of several other escape sequences, such as ',$,!, etc. Can someone help me out with this?

Thanks in advance,
Patrick
 
And this ?
AmpEsc = Replace(FirstName, "&", "%26")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
The webpage doesn't bomb using that line, but the ampersand and everything following it on the webpage doesn't show up when the link to the pop-up window is clicked on. Any ideas?
 
Disregard my last post. It works, I just overlooked something. Thanks a bunch!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top