Giter Site home page Giter Site logo

basemax / filterinputjs Goto Github PK

View Code? Open in Web Editor NEW
37.0 4.0 3.0 114 KB

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

License: GNU General Public License v3.0

JavaScript 100.00%
javascript javascript-library javascript-lib javascript-libraries js js-library js-libs purejs input input-validation

filterinputjs's Introduction

Filter Input

FilterInputJs

FilterInput

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

or use: https://cdn.jsdelivr.net/npm/filterinput/src/index.min.js

Install

This package available in the npmjs repository (filterinput), so you can easily install it with:

npm i filterinput

Features

  • Fast
  • Compact
  • No dependencies
  • Easy using Filters

Supported Tags

currently , only work on <input> tag.

  • input
  • textarea
  • select

Arguments

Argument Name Goal
data-filter Set type of Filter for a tag
data-filter-lang Restrict allowed languages (soon)

Data 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!
  • Alphabet0 (may be have number characters)
  • !Alphabet0 (may be have number characters) not empty!
  • Any (any char or empty)
  • !Any (any char , not empty)

Data Filter Languages

  • english
  • persian
  • arabic
  • all

You can discuss or send a request at here.

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.

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.