发布换行/回车作为隐藏字段值 [英] Post newline/carriage return as hidden field value
本文介绍了发布换行/回车作为隐藏字段值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要通过隐藏字段发布多行数据。数据将在发布后在textarea中查看。如何在HTML表单中发布换行符/回车符?
I need to post multi-line data via a hidden field. The data will be viewed in a textarea after post. How can I post a newline/carriage return in the html form?
我试过\r\\\
,但只是发布实际的\ r \\ \\ ndata
I've tried \r\n but that just posts the actual "\r\n" data
<input type="hidden" name="multiline_data" value="line one\r\nline two" />
有没有办法做到这一点?
Is there a way to do this?
推荐答案
取决于字符集的真实性,但是&#10;应该是换行和&#13;应该是回车。您应该可以使用value属性中的值。
Depends on the character set really but should be linefeed and should be carriage return. You should be able to use those in the value attribute.
这篇关于发布换行/回车作为隐藏字段值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文