Using a form.addField "RICHTEXT" and when I try an...
# suitescript
n
Using a form.addField "RICHTEXT" and when I try and add a line break to the rich text content I get the following: Welcome to the B2B ordering portal for Amplify Snack Brands. Here you can:&nbsp;<BR>• Submit an online order totaling 10 pallets or more. • View prior Orders. • Print an Invoice. The following is required when placing an order: • 10 pallets = order minimum • 14 days =lead time. How do I remove the HTML characters but force the line break?
s
I don't have much experience with this unfortunately, i'd try "\n" "\n\r" or "<\br>" or even "<p>"
t
Just copy pasted your text, works fine for me
message has been deleted
let me know if your actual string is different
n
@tuli the problem is the output on the suitelet front end. Not the richtext field itself. My String is what you have in the text field there but when output it adds the actual html <br> character instead of creating the break
t
Do you have a richtext field there on suitelet and setting the value to the same ?
drop a code snippet if possible so we can get more idea.
n
message has been deleted
That pic is in the UI for the suitelet. This is what is then being output on the frontend Suitelet: Welcome to the B2B ordering portal for Amplify Snack Brands. Here you can: <br>• Submit an online order totaling 10 pallets or more. • View prior Orders. • Print an Invoice. The following is required when placing an order: • 10 pallets = order minimum • 14 days =lead time.
s
I'm not sure your usecase, but if you're going to pick it up idk say post request and then reprocess it in the suitelet, and you want to remove the br, you probably want to do some .replace on this string and then replace it with "\n" or equivalent, and then this text value you get from the field will still "inherit" the line break
👍 1
and btw it's actually common practice, and it happens in say, some email merge scenarios in NS, and when you get the templates and you want to manipulate the strings, we always have to do the same stuff, like replacing the escape characters, and replacing the new line characters that's something you do have to do sometimes
n
@Sciuridae54696d i'll give that a try
success kid 1