Post

2 followers Follow
0
Avatar

Multi-line text field in calculation

I'm constructing an html table using a multiline text field, and if the multi-line text field has a hard return (paragraph mark) in it, it messes up the table. I've tried 

multilinestring.replace(/([^a-z0-9]+ )/gi, " ")

multilinestring.replace(/%0A/g, " ")

and a number of others without success. Has anyone come up against this - much appreciate any help

Andrew

Andrew Wardle

Please sign in to leave a comment.

2 comments

0
Avatar

Hi Andrew,

did you try multilinestring.replace(/\n/g," ") ? That should replace the p-tags. But depending on the text it can happen that the string is too long - which also messes up the table. 

But with some tricks and an elaborated code it's possible to keep the paragraphs without destroying the table (see the simple example in the screenshot). 

Rainer 

Rainer Grabowski 0 votes
Comment actions Permalink
0
Avatar

Rainer

As ever that worked a treat - thank you! Why didn't I think of that?

Best regards, Andrew

Andrew Wardle 0 votes
Comment actions Permalink