
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.
bootstrap-maxlength
Advanced tools

This plugin integrates by default with Twitter bootstrap using badges to display the maximum length of the field where the user is inserting text. This plugin uses the HTML5 attribute "maxlength" to work.
The indicator badge shows up on focusing on the element, and disappears when the focus is lost.
false.0.small form-text text-body-secondary but can be changed to anything you'd like.small form-text text-danger and can be changed.'' In this case, the limitReachedClass setting is used./.true.true.false.false.false.true.null.false.false.1099.bottom, left, top, right, bottom-right, top-right, top-left, bottom-left and centered-right. Are also available : bottom-right-inside (default option, as in Google's Material Design), top-right-inside, top-left-inside and bottom-left-inside.top, right, bottom, left, and position. These are passed to $.fn.css.Basic implementation:
$('[maxlength]').maxlength();
Change the threshold value:
$('input.className').maxlength({
threshold: 20
});
An example with some of the configurable options:
$('input.className').maxlength({
alwaysShow: true,
threshold: 10,
warningClass: "label label-info",
limitReachedClass: "label label-warning",
placement: 'top',
preText: 'used ',
separator: ' of ',
postText: ' chars.'
});
The same example using the message option:
$('input.className').maxlength({
alwaysShow: true,
threshold: 10,
warningClass: "label label-info",
limitReachedClass: "label label-warning",
placement: 'top',
message: 'used %charsTyped% of %charsTotal% chars.'
});
An example allowing user to enter over max characters. NOTE: you cannot have the maxlength attribute on the input element. You will need to provide the customMaxAttribute attribute
Sample HTML element:
<textarea class="form-control" id="xyz" name="xyz" maxlength="10"></textarea>
// Setup maxlength
$('.form-control').maxlength({
alwaysShow: true,
validate: false,
allowOverMax: true,
customMaxAttribute: "90"
});
// validate form before submit
$('form').on('submit', function (e) {
$('.form-control').each(
function () {
if ($(this).hasClass('overmax')) {
alert('prevent submit here');
e.preventDefault();
return false;
}
}
);
});
An example of triggering a maxlength.reposition event whenever an external autosize plugin resizes a textarea:
$('textarea').on('autosize:resized', function() {
$(this).trigger('maxlength.reposition');
});
FAQs
A visual feedback indicator for the MaxLength attribute
The npm package bootstrap-maxlength receives a total of 13,036 weekly downloads. As such, bootstrap-maxlength popularity was classified as popular.
We found that bootstrap-maxlength 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.