How to return html text using something like URLDecode

I pass the value of the text area in a.cfm in the variable GetXmlHttpObject to page b.cfm and display the value in a. How can I get the exact formatting of the text entered in the text area of ​​the a.cfm page into a div on the b.cfm page.

a.cfm
    <textarea name="sum1#i#" id="sum1#i#" html="yes" cols="98" rows="5"></textarea> [my text area]
    url=url+"?dept="+iden+"&desc="+encodeURIComponent(desc); [desc: value of text area]

b.cfm
    <cfoutput>
    <div style="border:1px solid">#URLDecode(desc)#</div>   
    </cfoutput>

How do I send a value as 'hellothere' encodeURIComponent: 'hello% 0Athere'

but it appears as β€œhello there” [in one line] I want it to be in: 'hello <break-line>there [[in two different lines, means in the same format as in the text area]

Thank!!!

+3
source share
1 answer

<pre></pre> .

<cfoutput>
    <div style="border:1px solid"> <pre>#URLDecode(desc)#</pre> </div>   
</cfoutput>
+5

Source: https://habr.com/ru/post/1740499/


All Articles