Skip to main content
March 25, 2008
Question

replace vbCrLf from a form

  • March 25, 2008
  • 6 replies
  • 711 views
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.
    This topic has been closed for replies.

    6 replies

    March 25, 2008
    Duhhh. :) I'll try to that.
    Participating Frequently
    March 25, 2008
    You can try reverse engineering. :)
    Participating Frequently
    March 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

    :)
    March 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?
    March 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?
    Participating Frequently
    March 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 />")>