开发者

How to get back text in html format by using something like URLDecode

I am passing value of text-area in a.cfm in variable of GetXmlHttpObject to b.cfm page and displaying the value in a . How can I get exact formatting of the text I entered in text-area of a.cfm page into div of 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>

Like I am sending value as 开发者_高级运维'hellothere' encodeURIComponent: 'hello%0Athere'

but its appearing 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 it was in text-area]

Thanks!!!


The <pre></pre> tags will preserve spaces and newlines.

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜