问题
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