如何将Enterkey从文本框中插入到html [英] how to insert enterkey from textbox to html

查看:102
本文介绍了如何将Enterkey从文本框中插入到html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想知道这个亲爱的朋友使用带有多行模式和一个按钮的文本框的即时消息,并在按钮单击事件上编写代码,该事件在按下按钮后,在文本框中写入的内容将写入html


多数民众赞成在正常工作..
但是当我在文本中写一些东西然后按Enter以换行并按button..then在html

hi dear all,

i want to know about this dear frnd i m using a textbox with mulitline mode and a button.and write a code on the button click event that after pressing button the things that is written in the textbox is write in the html


thats working fine..
but problem is there when i write somthing in the text and then press enter for new line and press button..then in the html

标记
在文本框中写的内容不是在我在文本框中写的那一行中..

请帮助亲爱的朋友.

thanx

tag
the matter which written in the textbox is come in the single line not as i write in the textbox..

plz help dear frnd..

thanx

推荐答案

html中的换行符由< br/>表示.标签.在呈现文本之前,您需要使用此标签替换所有文本换行符(\ n \ r)
A line break in html is represented by the <br/> tag. Before rendering the text you need to replace all text line breaks (\n\r) with this tag


这篇关于如何将Enterkey从文本框中插入到html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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