Skip to content

ZaifSenpai/jquery.inputfilter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jquery.inputfilter

jQuery plugin for adding filters to forms input and textarea, like numeric input only.

Installation

npm install jquery.inputfilter

Usage

import after jquery and configure inputfilter() to the jquery elements you want to apply filter

import $ from "jquery";
import "jquery.inputfilter";

// Standard options
$("input, textarea").inputfilter();
// Set options
const options = { allowNumeric: true, allowText: true };
$("input, textarea").inputfilter(options);

Options

const options = {
  allowNumeric: true, // is numbers allowed [0-9]
  allowText: false, // is text allowed [a-z|A-Z]
  allowEnter: true, // is Enter allowed
  allowCustom: [], // Array of chars to allow
  regex: null, // Regular expression of allowed chars
  maxLength: null, // Numeric value representing the maximum number of chars permitted
  actionLog: false, // Log actions
};

License

Copyright © 2015 Anders Fjällström, licensed under the MIT License

About

jQuery plugin for adding filters to forms input and textarea, like numeric input only.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%