回车在文本区域 [英] Carriage return in text area

查看:137
本文介绍了回车在文本区域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要允许用户在文本区域中输入回车;是这样的:

I have to allow the user to enter carriage returns in text areas; something like:

1句
句子2

Sentence 1
Sentence 2
...

我有加载和保存数据时要坚持这些回车。 我使用jQuery在客户端和.NET服务器上。关于如何处理任何建议?

I have to persist those carriage returns when loading and saving data. I use jQuery on the client side, and .NET on the server. Any suggestions on how to approach?

感谢。

推荐答案

如果用坚持的换行符( CRLF )你的意思是要正确显示它,像这样做,你需要的记住更换 CRLF 对与< BR />。CRLF

If by "persist" the line breaks (CRLF) you mean that you want to display it properly, as SO does, you need to remeber to replace the CRLF pair with <br/>CRLF.

否则,所有的文本将相继出现。

Otherwise, all your text will appear sequentially.

这篇关于回车在文本区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆