Transferred from: http://segmentfault.com/q/1010000002677808Writes the mobile web, defines a textarea, and adds some hints to the placeholder. Because some phone screens are different, the content of placeholder is not wrapped, but beyond the screen
Today, I have studied a little about the function of Automatically increasing textarea with input content. google has referenced some implementation methods, most of which rely on scrollHeight (not W3C standard, introduced by IE ), keyup event. It
Today, I have slightly studied the function of Automatically increasing textarea with input content, and I have provided some implementation methods through Google.
Most of them are completed by scrollheight (not W3C standard, introduced by IE)
This article mainly introduces the PHP variable in the foreground HTML textarea how to wrap and change the line changes in the PHP background, has a certain reference value, now share to everyone, the need for friends can refer to
The problem seems
TextArea Line Change
TextArea is saved to the MySQL database when using inline editing in the DataGrid in Easyui \ nEnter a return character in the textarea the value in the JS read textarea has \ r \ n then to the business layer conversion to
In textarea, press enter to generate the Escape Character \ r \ n. In some cases, we do not need these two escape characters, that is, clearing textarea. The following method is not empty, but can achieve similar results.
If you press enter in
First, it's not a simple question.
First, take the value:
$ ("#textarea"). Text ();//ReadThe latest test found in Firefox or Chrome read textarea value, ie normal.
It is then modified to:
$ ("#textarea"). Val ();Problem solved, but when searching,
Most of them are completed by scrollHeight (not W3C standard, introduced by IE) and keyup events. It is interesting to use "mirror element" and setTimeout round robin. The general implementation idea is as follows:The position: absolute method is
Most of them are completed by scrollHeight (not W3C standard, introduced by IE) and keyup events. It is interesting to use "mirror element" and setTimeout round robin. The general implementation idea is as follows:
The position: absolute method is
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.