JQuery calculates the number of words in the text box and limits the number of words in the text box.
Two Chinese characters, one symbol or number, and one English character are counted. (If it is set to 140 words, multiply by 2, then it is 280 words ). The Math. ceil method
The number of characters entered in the js calculated text box, and the number of characters in the js calculated text box
Use JavaScript to calculate the number of characters currently entered by a user in real time. Function Code:
The
Two Chinese characters, one symbol or number, and one English character are counted. (If it is set to 140 words, multiply by 2, then it is 280 words ). You need to use the Math. ceil method, because the number of words displayed to the user must be restored by dividing the last two. One Chinese character is counted as two, one symbol or number, and one English ch
A Chinese count of two, a symbol or a number, English, count one. (If the rule is 140 words, multiplied by 2, then 280). You need to use the Math.ceil method, because the last thing is to divide by the number of words displayed to the user;
$ (function () {var $tex = $ (". Tex");
var $but = $ (". but");
var ie = jQuery.support.htmlSerialize;
var str = 0;
var abcnum = 0;
var maxnum = 280;
var te
When developing applications such as short messages and app stores, we will consider adding the number of unread text messages to the icon of the short message, and adding the number of apps that can be upgraded to the app store, in this way, the goal of prompting can be achieved without occupying too much space.
This section uses an example of showing the
One of the most recent problems in doing a project to the text box in the user input text to be recorded, shown below, because we do is a text messaging platform, now our country's SMS service, if your message exceeds 70 characters, SMS will press two to you issued. So ask us to show the user how many words he entered. So that users know that my message will be d
Description
1 can only enter 0 to 9 and decimal points2 can only paste the number3 can't drag content in4 prohibit the use of input method
With the above, we can start.
Example (compatible IE, Firefox and other browsers)
The code is as follows
Copy Code
onkeypress= "Return event.keycode>=48event.keycodeOnpaste= "Return!clipboarddata.getdata (' text '). Match (/d/)"Ondragenter= "return False"Style= "Ime-mode:disabled">
Usually, the text box entered the number of words is not unlimited, generally will be limited to a maximum input, the more humane site may have input words inverted effect, such as the remaining 20 can enter such a hint, the following is an example to introduce how to achieve this effect.
First look at the effect chart:
The code is as follows:
Hopefully this article will help you learn about J
What is the optimal number of text boxes on a single page of the App ?, App text box count
[1]. The number of optimal text boxes on each page varies with mobile phone screens of different sizes.
[1.1] for iPhone 4 screen size, when the resolution is 640x960px, the maximum
If the implementation of a single line of text overflow display ellipsis students should know to use the Text-overflow:ellipsis attribute, of course, also need to add width of the genus to be compatible with some of the browsing.
Implementation method:
Overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
Effect
But this property only supports a single line
Text Box calculates the number of lines of text entered in a text box can be returned using SendMessage, and when a line of text is wrapped, it is treated as a new line, and the number of newline characters in the
Convert a number in a cell or a range of adjacent cells
1, click the Microsoft Office button, and then click Excel Options.
2, click the Formulas tab, and then do one of the following:
• Under Error checking, make sure that the Allow background error checking check box is selected.
• Under Error checking rules, make sure that the number in text format or the
In Photoshop, text typesetting is not as convenient as vector software (such as illustrator) and is not very powerful. But from the perspective of image editing, Photoshop is often used for text typesetting. Generally speaking, a small amount of text, input after the edit can be. Here is the main description of a large number
into my eyes,the eyes, the eyes, the eyes, notaroundthe eyes, Don.'T look around the eyes,Look to my eyes, you're under.Look to my eyes, look into Myeyes, the eyes, the eyes, the eyes, notaround the eyes, Don'T look around theEyes, look to my eyes, you're under.Look to my eyes, look into my eyes, the eyes, the eyes, the eyes, notaround the eyes, Don'T Look aroundThe eyes, look to my eyes, you'Reunder.>>>For the size of the terminal, it can be obtained by os.get_terminal_size ():Import os>>> os.
Javascript line number display text box (compatible with multiple browsers), js line number
Using JavaScript to create a very practical and simple text editing box, you can display the row number and be compatible with mainstream browsers such as ie and firefox, as shown bel
UILabel calculates the number of rows, expands the text, and shrinks the number of uilabel rows.
In iOS development, you sometimes need to obtain the number of lines of a string to implement specific functions. The following code is used to calculate the number of lines bas
Javascript records the number of characters in the text box to detect the number of characters
I recently encountered such a problem in a project. I want to count the text entered by users in the text box and display it below, because we are working on an SMS sending platfor
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.