These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

second line in the message box

DianaL
Registered: Nov 17 2009
Posts: 80

Hi Guys,

I have a new quick question!

where do I implement correct in the xfa.host.messageBox()

the \n in order to create a second line in the message box??

Thanks in advance!!!

Diana

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You do not use the Acrobat JavaScirpt new line code, '\n' when using FormCalc. You need to use the Unicode escape sequences, which are 6 characters long.

From LiveCycle Designer's Scripting Reference section "Literals"

>String literals>A string literal is a sequence of any Unicode characters within a set of quotation marks. For example:
>"The cat jumped over the fence."
>"Number 15, Main street, California, U.S.A"
>The string literal "" defines an empty sequence of text characters called the empty string.
>To embed a quotation mark character within a literal string, you must precede the quotation mark character with a backslash (\). For example:
>"The message reads: ""Warning: Insufficient Memory"""
A>ll Unicode characters have an equivalent 6 character escape sequence consisting of \u followed by four hexadecimal digits. Within any literal string, it is possible to express any character, including control characters, using their equivalent Unicode escape sequence. For example:
>"\u0047\u006f\u0066\u0069\u0073\u0068\u0021"
>"\u000d" (carriage return)
>"\u000a" (newline character)So, in place of the '\n' you would enter '\u000a' into your message string.

George Kaiser

DianaL
Registered: Nov 17 2009
Posts: 80
Hi,


thank you for this information!!!

I still dont receive a message box:

my code is"

xfa.host.messageBox("To proceed to PRINT VIEW, click YES!" \u000a\" To CLOSE the form, click NO!",3,2);


do you know what is wrong?

Thank you,

Diana
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
The unicode needs to be within the quotation marks for the string, since it is a string and is part of the entire string you want to display. You also need to either include a title for the message box or a null string, or the icon display parameter will be treated as the title.
xfa.host.messageBox("To proceed to PRINT VIEW, click YES!\u000aTo CLOSE the form, click NO!", "", 3,  2);

George Kaiser

DianaL
Registered: Nov 17 2009
Posts: 80
Thank you a lot!!!

it works now!! :)

Diana