Coder Social home page Coder Social logo

charlimiter's Introduction

#Char Limiter jQuery Plugin#

The Char Limiter is a plugin that limits the amount of characters in input and textarea, with the option of generating an automatic counter or you can create the counter and inform its class.

##Dependencies##

##Usage##

###Basic Form### Just to Limit the characters. Each counter can be limited individually through the attribute maxlength.

$(".input").charLimiter();

And just add the HTML maxlength attribute for both input and textarea

<input type="text" class="input" maxlength="10" />
<input type="text"  class="input" maxlength="20" />

###Options###

  • counterClass (default: "counter"): Class counter. Only class as selector.
  • generateCounter (default: false): Generates a counter, automatic, if true.
  • insert (default: "after"): Position on the counter is generated automatically inserted. Values ​​can be after ou before.

####Creating Your Own Counter#### If you want to create your own counter in a different position of the two possible through the insert you can create the place where you want the counter to appear and add the attribute data counter-rel in the field that you are limiting and also where the count will appear. This attribute data is what makes the connection between the two.

Example:

$('#input').charLimiter();
<input data-counter-rel="contador" type="text" id="input" maxlength="15" />
<p>The counter will not be inserted immediately after the input but after the P</p>
<span data-counter-rel="contador"></span>

And then we have the counter.

charlimiter's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.