Wrox Programmer Forums
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 5th, 2004, 01:52 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default simple but not working!

Hi there

I'm trying to replace the ' character in a string and it's not working and I don't know why: here's what I'm using

<%=Replace(strProductShort, "'", "''")%>

and here it is in situ:

<a href="#" onClick="javascript:window.open('pop_product.asp?I mage=<%=strImage%>&Alt=<%=Replace(strProductShort, "'", "''")%>', '_product','scrollbars=no,resizable=no,width=600,h eight=402')">

the error message is:

Expected ')'

The reason it appears is because there is a ' character in the string input in the database i.e adam's

Not sure how to fix it if the above is not working.


Old March 5th, 2004, 02:41 PM
Friend of Wrox
Join Date: Aug 2003
Posts: 205
Thanks: 0
Thanked 0 Times in 0 Posts

In javascript to escape a single quote(') you use \' not ''.

Similar Threads
Thread Thread Starter Forum Replies Last Post
window.opener working .... not working alyeng2000 Javascript How-To 5 January 5th, 2007 08:05 AM
Web.Config..Working or Not Working peace95 ASP.NET 1.0 and 1.1 Basics 1 September 18th, 2006 06:53 AM
Local COM working , but not working at Web Serv nagen111 .NET Web Services 3 February 19th, 2005 04:22 AM
Get Working Copy... not working Enkiel Classic ASP Basics 0 April 21st, 2004 01:41 PM
Simple but not working IF THEN statement nlicata Classic ASP Databases 6 June 6th, 2003 10:26 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.