Hi Phil, You can escape single quotes in JavaScript by adding a backslash before them like so: 'O\'Farrell'
Probably the easiest way to do this is with the JSStringFormat function: #JSStringFormat(this_name)# hth -- Lindsay Evans. Developer, Red Square Productions. [p] 8596.4000 [f] 8596.4001 [w] www.redsquare.com.au > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Phil Evans > Sent: Tuesday, 29 June 2004 3:19 PM > To: CFAussie Mailing List > Subject: [cfaussie] Javascript Problem > > > Hi All, > > I have a search page that returns a client name (and other > info) back to the calling page via Javascript. > > Code is > > <cfoutput> > window.parent.document.forms[1].client_name.value = > '#this_name#'; </cfoutput> > > It all works fine, until I came across a surname of > O'Farrell. The Javascript then fails because the string > contains a delimiter. > > I can strip the ' out of the surname, but ideally I'd like > the full string returned. I tried O"Farrell, but the > " did not substitute for ' > > Any ideas? > > Thanks, > Phil. --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/
