1.0.0 • Published 5 years ago

filterinput v1.0.0

Weekly downloads
4
License
GPL-3.0
Repository
github
Last release
5 years ago

Filter Input

Tiny and Powerful Library for limit an entry (text box,input) as number,string or more...

FilterInput.min.js File Size FilterInput.min.js Validation Code

Getting started

Add the following line to your .html file:

<script src="https://cdn.jsdelivr.net/gh/BaseMax/FilterInputJs@master/dist/index.min.js"></script>

or download the minified file

Features

  • Fast
  • Compact
  • No dependencies
  • Easy using Filters

Filters

  • Decimal
  • !Decimal (a decimal , not empty)
  • Integer
  • !Integer (a integer , not empty)
  • String (any character , no number)
  • !String (a string , not empty)
  • Alphabet (english,farsi:persian,arabic,china,...)
  • !Alphabet (english,farsi:persian,arabic,china,...) not empty!
  • Any (any char or empty)
  • !Any (any char , not empty)

Supported Tags

currently , only work on <input> tag.

  • input
  • textarea
  • select

Arguments

Argument NameGoal
data-filterSet type of Filter for a tag
data-filter-langRestrict allowed languages (soon)

Samples

To view the full details, run the example .html file.

data-filter

Decimal :
<input data-filter="decimal" value="5.64">
Integer :
<input data-filter="integer" value="91">

data-filter-lang

soon will be complete.

You can choose multiple languages. Separate them with ,.

onclick

soon will be complete.

Development

npm run dev
npm run build # build the production files

License

FilterInput is licensed under the GNU General Public License.