3 Replies Latest reply on Nov 27, 2006 6:50 AM by JK Hudson

    Ampersand in context menu problem

    JK Hudson
      Is there anyway to get the ampersand to show in the context menu. It's a simple string and I don't understand why it sees the ampersand as code instead of text. I've attached the affected code. Please help a newbie out!
        • 1. Re: Ampersand in context menu problem
          Level 7
          If the caption contains an ampersand, the character following the ampersand
          is underlined to indicate a keyboard mnemonic.

          Use two ampersands: "&&".

          • 2. Re: Ampersand in context menu problem
            clbeech Level 3
            Sure. There are several reasons why it may not be reading. the Ampersand is a special character (one of several) and often does not get interpreted as a 'string' character.

            First, is this a dynamic text field? If so, you may need to embed the special character set which includes the ampersand.

            Second (and first method to try), you may be able to 'escape' the character by preceeding it in your string using the ' \ ' or backslash just before the & ...

            "©2006 Name \& Name" ... like so.

            if that doesn't work then you need to describe the character using the ASCII code and adding the "fromCharCode()" command as in ...

            "©2006 Name " +String.fromCharCode(38)+ " Name"

            you use the ACSII number for whatever character you want within the (). '38' happens to be the code for an ampersand.

            hope this helps.
            • 3. Re: Ampersand in context menu problem
              JK Hudson Level 1
              Use two ampersands: "&&".

              Simple and effective. Thanks!