The formatting is saved automatically (they are just newlines).
I am assuming that you want to send an html email with the newlines converted to <br /> tags. In that case you should use the "Send xslt transformed email" workflow item and create an XSLT extension that can convert the newlines to <br /> tags. XSLT extensions are usable in contour as well, here's mine:
public class Strings
{
public static string ReplaceNewLinesWithHtmlBreak(string text)
{
return text.Replace("\n", "<br />");
}
}
Must be a problem with you replace function, there's definitely newlines in the save forms. Just click on the edit button for a form entry and see the text in the textarea still has the proper line breaks in there.
Yes thats right. And i hit enter many times when I made the comment
I tryed to replace all the 'g' instead to see if the worked. When I do that all the g's gets replaced with <br /> but it doesn't work as an html tag, it is just shown as text.
TextArea formatting
Hey..
I have a textarea field in a form. I want to save the formatting for the text that is typed. Is this possible?
The formatting is saved automatically (they are just newlines).
I am assuming that you want to send an html email with the newlines converted to <br /> tags. In that case you should use the "Send xslt transformed email" workflow item and create an XSLT extension that can convert the newlines to <br /> tags. XSLT extensions are usable in contour as well, here's mine:
Hmm. I'm making a comment function. The comment is the text typed in the textarea, which I want to be displayed with the right formatting.
I tryed to replace \n with <br /> but there aren't any \n in the entity saved from the form.
Hi Henrik
The \n entities are not visible but occur everytime you make a new line using enter.
So are you saying that there is not <br /> in your HTML code after the replace has been made?
/Jan
Must be a problem with you replace function, there's definitely newlines in the save forms. Just click on the edit button for a form entry and see the text in the textarea still has the proper line breaks in there.
Yes thats right. And i hit enter many times when I made the comment
I tryed to replace all the 'g' instead to see if the worked. When I do that all the g's gets replaced with <br /> but it doesn't work as an html tag, it is just shown as text.
Ah, you need to disable output escaping:
Thanks <br /> tag works now when I replace with 'g' but nothing happens when I try to replace with "\n"
This is what I do. I didn't make my own replace function.
<xsl:variable name="sss" select=".//fields/indlæg//value"/>
<p>
<xsl:value-of select="Exslt.ExsltStrings:replace($sss, '\n', '<br />')" disable-output-escaping="yes"/>
Just figured out that you should be able to do it quite easily like so:
Thank you :) It works
is working on a reply...