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
<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