Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Replace Line Feed a field with imported data

Avatar

Former Community Member

Hi, I’m trying to replace a line feed in a form field where data is imported to the field.

I can make the replace function work when typing into the field, but I can’t figure out how to make it work on imported data.

This is the script I use:

if (xfa.event.newText.match(/[\n]/) )

{

xfa.event.change = "LF"

}

Regards,

Kirstine

2 Replies

Avatar

Level 10

Hi,

So if I am getting you correctly, the imported data has the new lines (\n)?

You could try the layout:ready event and test against the field's .rawValue. But this is going to be very inefficient.

Niall

Avatar

Former Community Member

Hi,

I tried - it didn't work. So we have desided to deal with the new line issue prior to import.

Thanks anyway, Niall. :-)