Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

replace vbCrLf from a form

Participant ,
Mar 25, 2008 Mar 25, 2008
I can't figure out how to make carriage returns that people enter in forms into <br> tags in cfml. I looked up "replace vbCrLf" in google and got a bunch of asp results. Can anyone help me?

When people enter returns in my forms they get stripped off when inserted into the db. I need to prevent this.
631
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 25, 2008 Mar 25, 2008
You can easily replace CHR(10) and CHR(13) with <br /> tag.

Something like that:

<cfset newTextArea = replaceList(myTextArea, "#chr(10)#,#chr(13)#","<br />")>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 25, 2008 Mar 25, 2008
Thank you! Tested it out and it works well. That was a fast solution. Anything else I should be aware of that I can do to optimize form inputs?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 25, 2008 Mar 25, 2008
Now I have a new problem. What I'm trying to do is include the form message that I replaced with <br> into the body of another textarea when a person wants to reply. When I pull the original message in it's including the <br> tags which I don't want.... any suggestions?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 25, 2008 Mar 25, 2008
You can check other "fancy" and "featured" solutions in the cflib.org. :)

I can suggest to check out "ParagraphFormat2" UDF via http://cflib.org/udf.cfm?ID=38

🙂
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 25, 2008 Mar 25, 2008
You can try reverse engineering. 🙂
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 25, 2008 Mar 25, 2008
LATEST
Duhhh. 🙂 I'll try to that.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources