cancel
Showing results for 
Search instead for 
Did you mean: 

Adobe Form -Table Text Field - Split string at Semicolon into multiple lines

kirankerudi
Active Participant
0 Kudos
898

Hello Experts,

I have a table in Adobe Form that looks like below and as you see on 'Column 6', I have a long text separated by semicolons. This data need to be split at semicolon and displayed as new line in the text field, as shown in 'To Be'.

As Is:

To Be:

I have tried the below script

var strng = this.rawValue;
strng.replace(/;/g, "\n");

as well as below

var strng = this.rawValue;
strng.replace(/;/g, "<br>");

But none of them works at Initialize or Exit event. I know I am doing something wrong, but could not figure it out. Any help is much appreciated.

Thanks!

Sandra_Rossi
Active Contributor
0 Kudos

Just to help troubleshooting, at least can you make this display "test" in your form?

this.rawValue = "test";
Sandra_Rossi
Active Contributor
0 Kudos

I found many answers for the same question.

One says to use a text field of type rich text, not plain text.

View Entire Topic
kirankerudi
Active Participant

Hi Sandra,

Sorry for my late response. I could resolve this using Text Field.

But, I had to use the FM IDMX_DI_TLINE_INTO_STRING which can convert the table data to string (which adds new line character as well) and then assigned this string to the Text Field.

Appreciate your response and time on this.

Thank you!

Sandra_Rossi
Active Contributor
0 Kudos

For information, IDMX_DI_TLINE_INTO_STRING is rarely mentioned in the forum, I prefer using CONVERT_ITF_TO_STREAM_TEXT, I feel it's more resistant to future deprecation (but who knows!), there's also the opposite CONVERT_STREAM_TO_ITF_TEXT (for well-known function modules like SAVE_TEXT). Line breaks can be the characters LF or CRLF.