Javascript will see the \ as an escape sequence -- if you double up the \, then it
should retain it: A simple replace should do it:
<cfset tmpFile = "\\somemachine\somedir\some.exe">
<cfset tmpFile = Replace( tmpFile,"\","\\","all")>
----- Original Message -----
From: "Edwards Robert (air0rae)" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, August 22, 2002 9:28 AM
Subject: Problem with "\" in a Javascript/Query
> I have a page that populates a combo box via javascript. The data that is
> returned from a query is (quotes included) "\\somemachine\somedir\some.exe".
> The Javascript sets the value via the code new
> Option('"\\somemachine\somedir\some.exe"','"\\somemachine\somedir\some.exe"'
> ) (that's the double quotes within single quotes if it's not too clear).
>
> The problem is, it translates out to \somemachine
> omedirsome.exe
>
> (the somedirectory begins with a t, so I'm thinking that it's translating it
> to a tab character). When I pass the selection to another page, it passes
> the tab and the formatting as translated, what I need is for the slashes and
> characters to be passed as that are in the DB.
>
> Is there anything I can do with regex or something to keep the slashes the
> way they are? Kind of like PreserveSingleQuotes.
>
> TIA,
>
> Rob Edwards Phone: (502) 359-1627
> Systems Management Tools Pager: (502) 478-1116
> United Parcel Service Fax: (502) 359-0094
> EMail: [EMAIL PROTECTED]
>
> (2B || !2B) == ?
>
>
>
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists