aaronrussell / jquery-simply-countable Goto Github PK
View Code? Open in Web Editor NEWjQuery plugin that provides a character counter for any text input or textarea.
Home Page: http://github.com/aaronrussell/jquery-simply-countable/
jQuery plugin that provides a character counter for any text input or textarea.
Home Page: http://github.com/aaronrussell/jquery-simply-countable/
Could this be updated for jQuery 2.0? Or, tell me what I need to look for to enable compatibility?
the character counter does not work on copy/cut paste mouse events.
your response is highly appreciable
Regards,
Muhammad Hisham
Currently, the counter only updates on keyup, blur, or paste events.
So when you set the value using javascript, the counter doesn't change.
My current workaround is to manually trigger a "blur" event after setting the value....
$('#myTextarea').val("some text"); // counter doesn't update
$('#myTextarea'),blur(); // make counter recognize text change
I'm not sure if there's an easy solution to this issue that will work with all browsers, but I think it should be a future enhancement if it is possible.
hello,
I would like to know how to change the position of the countable because I would like to have this on the bottom of my text area.
Thanks
After fixing demo.html to count words on #demo2 (see issue 7), I tried to test. This value correctly counts 11 words:
one two 3 four five. 6666. seven. eight. nine. 10. eleven.
However, this value only counts 10:
one two 3 four five. 6666.
seven. eight. nine. 10. eleven.
I believe the default value for wordSeparator should be '\s' (any white space). This means the strictMax truncation would have to be modified to maintain the original white space up to maxCount.
Hello,
I'm trying to make this work with a WYSIWYG editor like Redactor.
Does this plugin counts chars inside a div as well? Or only text areas and input fields?
Thanks in advance.
In demo.html, characters are being counted for #demo2 instead of words:
$('#demo2').simplyCountable({
counter: '#counter2',
countType: 'characters',
maxCount: 10,
countDirection: 'up'
});
Just as simple as that the counter is off by the number of line breaks you enter.
I have a form thats submitted with ajax, and the counter shows the remaining characters (if any) and won't update until a user starts typing again. Any way to reset the count on submit?
I would like to append some alert text to the DOM after the user reaches the Max word count. I'm using strictMax: true and the onMaxCount callback function.
The alert text is continually being appended when the keyboard is pressed. How can I have this text append only once?
It would be nice to have a way to change maxCount dynamically
Hi!
Is it possible to restrict the input of whitespaces if the counter exceeds the maxCount figure? โ ATM there is only a restriction for characters/numbers but not for whitespaces.
Thanks a lot and best regards! โ sokai
Safe/Over Class & onSafeCount not working with strictMax set to true.
My Code:
$(this).simplyCountable({
counter: $msgElem,
countType: 'words',
maxCount: 5,
strictMax: true,
safeClass: 'is--safe',
overClass: 'is--over',
countDirection: 'down',
onSafeCount: function(count, countable, counter){
console.log('safe');
},
});
May I suggest you add a gh-pages branch to host the demo ( free on GitHub Pages ).
Thanks for this excellent plugin BTW!
Hi,
Would be great if the plugin supported both character and word modes. I will see if I can fork it and push the change, but for now am on a tight deadline. :-)
Regards,
Kobus
is there any event in your plugin that i can insert my function when i reached to max character limit?
I find that this doesn't work within model windows and i have a suspicion its todo with the fact you're not using the jquery .live() function as some modals alter DOM objects after page load.
Can you please add the ability to use data attributes on the element ( input or textarea ) ?
It's really very helpfull to get working the plugin juste using the data attributes.
Ex : data-maxCount ...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.