Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🔔 Get a warning when the maximum char limit has been exceeded with a simple jQuery plugin

NotificationsYou must be signed in to change notification settings

JoanClaret/max-char-limit-warning

Repository files navigation

Plugin preview

Maximum Characters limit exceeded warning

Get a warning when the maximum char limit has been exceeded with a simple jQuery plugin

  • Only 1 js file
  • < 1Kb minified (495 bytes)
  • Easy to implement
  • Works with inputs, textareas.

npm versionJoin the chat at https://gitter.im/JoanClaret/max-char-limit-warning

Online demo

Visit codepen.

Installation

1. Grab a copy of the plugin

Using bower

bower install max-char-limit-warning --save-dev

Using npm

npm install max-char-limit-warning --save-dev

ordownload the plugin from GitHub

2. Load the required javascript files

Load them in the html

<!-- jQuery library (served from Google) --><scriptsrc="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script><!-- jcSlider Javascript file --><scriptsrc="jquery.maxcharwarning.min.js"></script>

or use Browserify

require('maxCharWarning');

3. Create the HTML markup

<inputclass ="js-max-char-warning"placeholder="Your name"type="text"data-max-length-warning="limit exceeded"data-max-length="10"data-max-length-warning-container="name"/><spanclass="name"></span><!-- Display warning message here -->

4. Initialize the plugin

Default initialization

<scripttype="text/javascript">    $(document).ready(function(){$('.js-max-char-warning').maxCharWarning();});</script>

Follow the repository

★ Star and watchthis repo in order to stay updated with news about this plugin

Other useful plugins

License

The MIT License (MIT)Copyright (c) 2015 Joan ClaretPermission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.

About

🔔 Get a warning when the maximum char limit has been exceeded with a simple jQuery plugin

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp