Returns string with converted single newline characters (CR/LF sequences) into spaces and double newline characters into HTML paragraph markers (<p>
).
Display and formatting functions
ParagraphFormat(string)
Parameter |
Description |
---|---|
string |
String to convert to the HTML paragraph format |
ParagraphFormat is useful for displaying data entered into TEXTAREA fields.
<!--- This shows ParagraphFormat ---> <html> <head> <title> ParagraphFormat Example </title> </head> <body bgcolor = silver> <H3>ParagraphFormat Example</H3> <P>Enter some text into this textarea, and see it returned as HTML. <cfif IsDefined("FORM.myTextArea")> <P>Your text area, formatted <P><cfoutput>#ParagraphFormat(FORM.myTextArea)#</cfoutput> </cfif> <!--- use #Chr(10)##Chr(13)# to simulate a line feed/carriage return combination; i.e, a return ---> <form action = "paragraphformat.cfm" method = "POST"> <textArea name = "MyTextArea" cols = "35" ROWS = 8> This is sample text and you see how it scrolls<cfoutput>#Chr(10)##Chr(13)#</cfoutput> From one line <cfoutput>#Chr(10)##Chr(13)##Chr(10)##Chr(13)#</cfoutput> to the next </textArea> <input type = "Submit" name = "Show me the HTML version"> </FORM> </body> </html>