
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
jquery-countchar
Advanced tools
A simple counter of characters for multiple form fields based on jQuery
A simple counter of characters for multiple form fields based on jQuery
Example is located here.
Install via bower:
$ bower install jquery-countchar --save
or via npm:
$ npm install jquery-countchar --save
or download the jquery.countchar.min.js file into your repo.
Then, include script file after the jQuery library and initialize the plugin:
$('.selector').countChar();
You can use the following options as plugin params:
text — Text for the counter;textPosition — Text position for the counter: before or after. Defaults to before;limit — Maximum number of characters for each field;limitErrorClass — Error class name for limit. Defaults to countchar-limit-error;outputContainer — Container for output text and counter. Defaults to #countchar-output;onLimitCallback(el, value) — Callback function called when limit condition worked;onCounterCallback(number) — Callback function called each time when it counted the number of characters.Also, you can add data-countchar and data-countchar-limit attributes to set a regular expression and a characters limit for the current form field. For example:
<input type="text" name="example" data-countchar="[\d]+" data-countchar-limit="10">
It will count only numbers and the maximum number of characters will 10. If the characters will be more, it will add error class to the input element. The priority data-countchar-limit more than the limit parameter.
MIT © Ilya Fedotov
FAQs
A simple counter of characters for multiple form fields based on jQuery
We found that jquery-countchar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.