Need JavaScript Help on How to Create New Line in Document Rendered in HTML

Avatar

Avatar
Validate 1
Level 1
chapmawi
Level 1

Like

1 like

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
chapmawi
Level 1

Like

1 like

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
chapmawi
Level 1

13-12-2018

Hi Everyone,

I'm new to the Adobe forums.  I had previously posted this message in the AEM forum but was told I needed to post it in the LiveCycle forum.  Please redirect me if I'm still not in the correct place.  So here's my problem:

I'm creating a letter document using AEM Designer.  I need to have the data elements for an address formatted as shown:

Name

Address 1

Address 2

City, State Zip

All are data elements mapped into the letter xdp. I'm using the following JavaScript to conditionally exclude Address 2 if it contains a null value:

if (Address2.rawValue != null) {

   Address.rawValue = MailTo.rawValue + "\u000a" + Address1.rawValue + "\u000a" + Address2.rawValue + "\u000a" + City.rawValue + ", " + State.rawValue + " " +         ZipCode.rawValue;

} else {

   Address.rawValue = MailTo.rawValue + "\u000a" + Address1.rawValue + "\u000a" + City.rawValue + ", " + State.rawValue + " " +ZipCode.rawValue;

}

This works when the document is rendered as a pdf but I need it render in HTML because it will be presented to the user in a browser.  I can't find an example of what the correct syntax should be. 

Thanks to anyone who replies.

Willie Chapman

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
Level 1
chapmawi
Level 1

Like

1 like

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
chapmawi
Level 1

Like

1 like

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
chapmawi
Level 1

14-12-2018

I didn't know that but my company has selected Chrome as our default browser. Thanks for the reply though.

Avatar

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 4
MinusZero
Level 4

Likes

30 likes

Total Posts

326 posts

Correct reply

54 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
MinusZero
Level 4

13-12-2018

I am not familiar with AEM Forms, but did you know that dynamic forms work in Internet Explorer as a PDF. They wont work in other browsers.