profanity-input-field
v2.0.3
Published
A plug-and-play input form field that contains set of rules on profanity filters.
Downloads
5
Maintainers
Readme
profanity-input-field
input field that auto-validates the text entered by the user and checks for the list of bad words and gives an alert on the user interface.
Installing
Using npm:
$ npm i profanity-input-field
Using bower:
$ bower install profanity-input-field
Using yarn:
$ yarn add profanity-input-field
Usage:
Import:
import {profanityCheck} from "profanity-input-field";
Form Data: Use the form fields as below.
`
Error Field : <span id="errorinfo" className="hide"></span>
Input Field : <input type="text" id="profane-input" data-errorinfo="Field can't contain profane words"></input>
Button(OnClick): <button onClick={profanityCheck}>Submit</button>
`
NOTE:
HTML attributes plays crucial role for functionality to work. Make sure they are provided exactly the same
in your HTML structure.