For example, when entering:
I'm a painter.
Hello everyone
La La la
After the input has been submitted, turn into:
I'm a painter.
Hello everyone
La La la
Deposit Database
Reply content:You do not have the rich text of the demand, it is recommended that you do not in the data inventory HTML. Because you cannot escape directly to the output to ensure security (the content is already HTML). This is a time when you want to filter for XSS. If you're talking about a rich text editor, it's a lot
if you use the attribute word width (Cols) and number of rows (rows) of textarea to control the size of textarea, in IE and FF, the number of words in each line and the number of lines in the text are not the same, and IE has a scroll bar by default when the number of words is insufficient, while FF has no scroll bar. how to control the same effect of textarea
This article describes how to limit the number of words input by textarea in JavaScript. It has good reference value. Let's take a look at it below. This article mainly introduces the principle and method of implementing textarea to limit the number of words input in JavaScript. It has good reference value. Let's take a look at it together with the small Editor.
Implement
This format control and editing coordination FCKeditor is used, is perfect, fckeditor use in my other posts have a simple introduction.
When you read data from a textarea, and then read the data from the database, the simplest way to control how it appears in the JSP page as entered in textarea is to use
Adding such a statement to a CSS file can fix this probl
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, it was found that someone asked another question:
When you type a carriage return in a
Extend the TextArea property, combined with Jquery.validate.js, and validate the length of the textarea at the same time as submitting the form.
1.jQuery plug-in for TEXTAREA length verification
Copy Code code as follows:
Verify the length of the textarea
JQuery.fn.checkLength = function (parameters)
Div simulates textarea to achieve high self-growth, divtextarea
Today, a front-end friend suddenly asked me how the height of textarea increases with the content. I suddenly lost my mind. The first thing I thought was to use js to change the height of textarea, however, Baidu's reference code is not very effective.
Because the
A recent detail has caught my attention, the Chrome browser input and textarea in the focus of the time have a yellow border, and textarea can also arbitrarily drag to enlarge, which is not tolerated, the influence of beauty does not say, Sometimes dragging textarea also causes the page layout to be garbled, so you decide to reset the styles.Look at the code:Canc
(1) obtain the starting point of the selected area of Textarea or the input cursor position when no selection is madeNon-ie browsers, such as firefox and chrome, support selectionStart to obtain the starting point of the selected region. ie does not support this attribute and needs to be obtained indirectly through TextRange, you can use the compareEndPoints method of the TextRange object to compare the start point.Copy codeThe Code is as follows:GetS
Introduction1. This textarea is when you create a calendar like Google Calendar that describes a new or updated one that exists;2. Its height will change the variety of the user input;3. Its scroll bars are removed, which makes the user friendlier. I guess you might like it.
Using code
1. Import the jquery. Web Effects and Textarea.js
The code is as follows
Copy Code
2. Add the following
The example in this article describes how PHP gets the value of textarea and handles the method of carriage return line wrapping. Share to everyone for your reference. The implementation methods are as follows:
In general, in the HTML form textarea we press carriage return and newline are some ASCII or special character encoding, if not the conversion output text is not typesetting.
PHP Gets the
For example, when I input the data, I am a fan painter. Hello, I submitted the data and converted it into: I am a fan painter. Hello, I saved the data to the database. for example, when I input the data:
I am a painter
Hello everyone
La la
After the input is complete, submit it and convert it:
I am a painter
Hello everyone
La la
Save to database reply content: You do not need rich text. we recommend that you do not store HTML in data. Because when the output is complete, yo
Today, while doing our form submission section, we encountered this problem, so we can solve it with the legendary jquery.
This is mainly about the focus in IE under the problem, because in Firefox is to support
Copy Code code as follows:
Input:focus
Textarea:focus
Under IE: focus is not valid, so we have to add a new style to input and textarea after clicking to fit the implementation: the effect.
Let's look at the effect first:
Take
html:form Summary of the form, Input,select,option,textarea,label
The standard properties of the form label are Id,class,style,title,lang,xml:lang.
The form can contain input elements (including button,checkbox,file,hidden,image,password,radio,reset,submit,text), menu, textarea, fieldset, Legend and label elements. The Action property indicates where the form data is sent when the form is submitted (the f
I am using the webbrowser control to create an automatic filling program. Automatic Filling is simple. The page is composed of text elements, several single-choice items, and so on. You can get the set value, but at last I encountered a very tricky problem, that is, there is a text editing area of textarea. This editing area is similar to the QQ space and other editing areas used to write logs, but it only has fewer editing functions than them. At fir
The Chrome browser input and textarea in the focus of the time there is a yellow border, and textarea can also arbitrarily drag to enlarge, which is not tolerated, the impact of beauty does not say, sometimes drag textarea will also make the page layout confusion, so decided to reset these styles.To cancel the focus border of input and
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.