ColdFusion HTML表单用引号引起来

问题描述

奇怪的是,我有一个不会加双引号的表格?

例如:

10 and single ' this" And " Another

在“输入”表单中,停止于: 10 and single ' this

为什么不保留双引号? “

我的表单类型确实为:enctype="application/x-www-form-urlencoded"

我还有其他带引号的表格。

解决方法

这里发生的是,文本10 and single ' this" And " Another中的双引号引起了输入元素的破坏。

带有"的文本将提前结束value属性。

例如<input value="10 and single ' this" And " Another">

要克服这一点,您需要使用用户

<input value="#encodeForHTMLAttribute(formValue)#">