RE: CF and JavaScript HELP - Maybe OT?
Forgot to mention we're stuck in CF 4.0, but thanks for the response. Nice to know someone cares ; ). I think I'll have to manually escape each special character withcfset mystring = Replace(mystring, ', \', ALL) Maybe you have a better solution? John -Original Message- From: Ubqtous [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 14, 2004 9:50 PM To: CF-Talk Subject: Re: CF and _javascript_ HELP - Maybe OT? John, On Wednesday, January 14, 2004, 4:34:22 PM, you wrote: JG Everything works fine until I get a non alpha-numeric character, JG i.e., ., , ', /, , (, ), in the #WholeName# JG variable. Then, _javascript_ bombs and returns an error: error JG expected ';'. JG Can someone help me with handling regular expressions in JG _javascript_, so the above code will accept special characters in JG the name? Grateful doesn't begin to describe how I'll feel. Perhaps JSStringFormat() would help? ~ Ubqtous ~ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: CF and JavaScript HELP - Maybe OT?
John, On 1/15/2004 at 10:07, you wrote: JG I think I'll have to manually escape each special JG character with cfset mystring = Replace(mystring, ', \', JG ALL) JGMaybe you have a better solution? If CF4 supports replacelist(): cfscript mystring=foo to the bar; lstbad=foo,bar; lstgood=\foo,\bar; mystring=replacelist(mystring,lstbad,lstgood); /cfscript This is probably not a very efficient approach if your code is heavily trafficked, but nothing else comes to mind... ~ Ubqtous ~ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
CF and JavaScript HELP - Maybe OT?
Tough day. Alzheimers is acting up. I have the following _javascript_ code: script language=_javascript_ cfloop query=get_individuals cfoutputcfset valuedata=#cattasc_member_id#/cfoutput cfoutputcfset optiontext=#WholeName#/cfoutput cfoutputc=#currentrow#-1;/cfoutput//599 var nopt = new Option(); cfoutputnopt.value = #valuedata#;/cfoutput cfoutputnopt.text = #optiontext#;/cfoutput parent.frames[0].document.all.individuallist1.options[c] = nopt; /cfloop /script Everything works fine until I get a non alpha-numeric character, i.e., ., , ', /, , (, ), in the #WholeName# variable. Then, _javascript_ bombs and returns an error: error expected ';'. Can someone help me with handling regular expressions in _javascript_, so the above code will accept special characters in the name? Grateful doesn't begin to describe how I'll feel. John Sent via Pastors.com Free WebMail http://www.pastors.com [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: CF and JavaScript HELP - Maybe OT?
John, On Wednesday, January 14, 2004, 4:34:22 PM, you wrote: JG Everything works fine until I get a non alpha-numeric character, JG i.e., ., , ', /, , (, ), in the #WholeName# JG variable. Then, _javascript_ bombs and returns an error: error JG expected ';'. JG Can someone help me with handling regular expressions in JG _javascript_, so the above code will accept special characters in JG the name? Grateful doesn't begin to describe how I'll feel. Perhaps JSStringFormat() would help? ~ Ubqtous ~ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]