• ricohusa
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hi,
 
I have a question about use special characters in opportunity name:
 
 
I created an opportunity which has double quotation " and the prime ', the name is:
 
 
special"ABC'123/\*
 
 
Now I want to use this name in my S-Control which is using HTML code, actually
I want to remove the speical characters,  to make it as
 
specialABC123
 
But if I put the above string in a Javascript function like this:
 
var str = "{!Opportunity.name}"                      or   var str = '{!Opportunity.name}' 
 
 
Since  {!Opportunity.name} only replaces the whole string directly
without encoded or escaped, the string is like this:
 
"special"ABC'123/\*"                                       or  'special"ABC'123/\*'
    
 
None of them could work properly because either the double quotation " should be
escaped as \" or the prime should be escaped as \' to make the Javasrcipt string
as a valid string.
 
Does anybody know how to use the opportunity name string  as encoded or escaped?
The only way I know how to use it is:
 
{!Opportunity.name}
 
but this does not work properly in the above case.
 
 
 
Thanks.