本文转载自:http://txin0814.iteye.com/blog/1161270

<TextArea>提交表单后显示的内容前出现大段的空格,使用trim()也没有效果,其实原因很简单。

<TextArea>控件没有value属性,文本内容一般都是这样显示<TextArea>文本信息</TextArea>。但如果你的代码是这样写的<TextArea>

            .....文本信息.....

</TextArea>,那么肯定就会出现上述问题。去掉文本前的空格只需要改成这样,<TextArea>文本信息</TextArea>。记住千万不要将首尾标签换行,不然它会将/n也当做是它的文本内容。

相关文章:

  • 2021-08-09
  • 2021-11-18
  • 2021-10-26
  • 2022-12-23
  • 2022-12-23
  • 2022-01-22
  • 2021-09-21
  • 2022-01-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-15
相关资源
相似解决方案