Bootstrap Maxlength is a visual feedback indicator for the maxlength attribute. For more info please visit the plugin's
Homeor
Github Repo.
Usage
Bootstrap Maxlength's Javascript files are bundled in the global plugin bundles and globally included in all pages. However, the maxlength functionality requires a manual Javascript initialization.
<label class="form-label">Basic example</label>
<input type="text" class="form-control" id="kt_docs_maxlength_basic" maxlength="10" />
<span class="fs-6 text-muted">The badge will show up by default when the remaining chars are 3 or less</span>
Threshold
An example of Bootstrap Maxlength with a treshold option. The
thresholdoption is to set the minimum number of characters that will display the badge.
Set threshold value to show there are 20 chars or less left
<label class="form-label">Threshold example</label>
<input type="text" class="form-control" id="kt_docs_maxlength_threshold" maxlength="25" />
<span class="fs-6 text-muted">Set threshold value to show there are 20 chars or less left</span>
Always Show
An example of Bootstrap Maxlength with an always show option. Add
alwaysShow: truein the Javascript.