Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default newline to <br>?

    When doing a databse query, how do yu contvert your newlines to <br>?
    tommarius Guest

  2. Similar Questions and Discussions

    1. adding newline in xml export
      I'm using ID CS on win2k and I'm wondering how to add new lines after xml elements that I'm creating. It's saving the whole export on one line. TIA
    2. Newline in XML
      Hello Is there any way to insert new line charcter in an Attribute of XML and let flash read it dinamicaly? Something like this XML-Code ...
    3. newline problem
      I just installed php 4.3 on windows xp. It seems that new lines are ignored. The following code <?php for ($i=0; $i<10; $i++){ print "test"; }...
    4. prevent newline in datagrid
      Hello Newsgroup! I have a DataGrid. In the cells of this DataGrid are strings displayed which consists of more then one word. When the collum of...
    5. newline
      How can i make a newline in a sprite of a text-member with lingo? THX Wolfgang
  3. #2

    Default Re: newline to <br>?

    Well I find it best to add the <br /> tags when I add them to the database.
    That way I can output them in HTML with out any additional formatting. I only
    need to remove them if I want to make them editable in a form.

    To accomplish this I do as follows.

    <!--- this is a new line --->
    <cfset CrLf = Chr(13) & Chr(10)>

    <!--- add br tags --->
    <cfset Result = Trim(Replace(FORM.TextBox, CrLf, "<br />", "ALL"))>

    You can just do the reverse to take them out.

    <!--- strip out <br /> tags --->
    <cfset Result = Trim(Replace(DatabaseValue, "<br />", CrLf, "ALL"))>

    If you wist to continue as you have then you will have to experiment as to how
    your database stores line breaks. Some use Chr(10) and some use Chr(10)
    followed by Chr(12).

    Stressed_Simon Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139