SOLVED

Re: Carrying Text Field Formatting Over into a Token in an Alert

Go to solution
Josh_Perry1
Level 7

Carrying Text Field Formatting Over into a Token in an Alert

We have a couple of forms that include text fields.  These fields are used to allow people to tell us what they need help with.  Once the form is filled out, an alert is sent to the appropriate person to follow up.  Sometimes, these people provide multiple paragraphs of information.  The people who recieve the alert, would like to see the text field formatted the way the person who had filled out the form intended it to be.  So if there are multiple line breaks, those should be included in the alert.  Marketo's out of the box solution does not allow for a way to make this happen.  Does anyone have any ideas on how to make this work?
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: Carrying Text Field Formatting Over into a Token in an Alert

Problem arises from the fact that line breaks \n are not the same as HTML < br /> tags
 
Possible solution resourcing to JavaScript
 
var text = document.forms[0].txt.value;
text = text.replace(/\r?\n/g, '<br />');

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Re: Carrying Text Field Formatting Over into a Token in an Alert

Problem arises from the fact that line breaks \n are not the same as HTML < br /> tags
 
Possible solution resourcing to JavaScript
 
var text = document.forms[0].txt.value;
text = text.replace(/\r?\n/g, '<br />');