How to encode HTML form in coldfusion?

爷,独闯天下 提交于 2020-01-03 15:33:56

问题


I'm new to coldfusion.

I have page called test1.cfm

<form action = "test2.cfm" method = "post">
    Type your name and hit submit:<br>
   <input type = "Text" name = "txt1">
   <input type = "Submit" name = "" value = "submit">
</form>

And test2.cfm

<cfoutput>
    success
    #form.txt1#
    <a href="test1.cfm">back</a>
</cfoutput>

Now I want to know if we can encode the displaying of text value in test2.cfm page. For eg. if we type <br> in the textbox, test2 page will render it as html, and I want to stop rending and it should display as text.

Thanks


回答1:


It's HTMLEditFormat(), not code.




回答2:


Use #htmlCodeFormat(form.txt1)#



来源:https://stackoverflow.com/questions/3340968/how-to-encode-html-form-in-coldfusion

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!