Link to home
Start Free TrialLog in
Avatar of fedkris
fedkris

asked on

Problem with Apostrophe with passing values

When we pass variables, it works fine. Exemple:

fld129                    street                   city                postcode
Cityhopper   avenue deroovere      london                1000

But when we have an adres, a name with ' (apostrophe) , it blocks, how can we pass these problem?
fld129                    street                   city                postcode
City'hop               's rooverstreet    london              1000

Can anybody help me? thx!


<a href='javascript:ShowGoogleMap("<#F FIELD=fld129>", "<#F FIELD=STREET>", "<#F FIELD=CITY>","<#F FIELD=POSTCODE>")'>
	   <img src="images/but_roadmap_nor.gif" width=20 height=20 border=0 hspace=4 ALT="<#LABEL NAME='View in Googlemap'>"</A>
 
 
 
----------
 
 
function ShowGoogleMap(cy,adresse,ville,cp)
		{
		s = "http://192.168.2.5/elink/google_map.asp?cy=" + cy + "&adresse=" + adresse + "&ville=" + ville + "&cp=" + cp
  		var wnd = window.open(s, "_blank","width=730,height=580,scrollbars=no,toolbar=no,location=no") 
 		 wnd.focus()
 
		}

Open in new window

Avatar of Mick Barry
Mick Barry
Flag of Australia image

try replacing them with ''

ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MikeRCWatts
MikeRCWatts

I thiunk the problem may be in your receiving asp.

Check whether the command line passed to it looks as you expect.  I think apostrophe is OK unescaped in a url.

See the following asp test of that.  (name the file test_asp_get.asp and run it - shows apostrophe gets through OK.
<%@ Language=VBScript %>
<HTML>
<BODY>
<h1>Test</h1>
 
<SCRIPT LANGUAGE=vbscript RUNAT=Server>
Response.Write "City=:-" & Request.querystring("City") & "-<br>"
</SCRIPT>
<br><br>
 
<a href="test_asp_get.asp?City=Abc'def">Test Abc'def</a> <br><br>
 
</BODY>
</HTML>

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial