1.0.0 • Published 11 years ago
cjk-protector v1.0.0
cjkProtector jQuery plugin
Protect your inputs/textareas from Chinese, Japanese and Korean (CJK) characters.
Usage
<form>
<div>
<input type="text">
</div>
<div>
<textarea></textarea>
</div>
<input type="submit">
</form>$(":input").cjkProtector();Options
errorClass (string)
CSS class name added on input's wrapper div element when CJK characters are found.
Default value is 'field_with_errors'
$(":input").cjkProtector({
errorClass: "cjk_error"
});errorMessage (string)
Error message displayed when CJK characters are found.
Default value is 'Please use latin characters'
$(":input").cjkProtector({
errorMessage: "CJK characters found!"
});onError (function)
Called when CJK characters are found.
Default value is empty
$(":input").cjkProtector({
onError: function() {
console.log("CJK characters found!")
}
});onSuccess (function)
Called when CJK characters disappear.
Default value is empty
$(":input").cjkProtector({
onSuccess: function() {
console.log("Valid characters!")
}
});Running specs
First, you have to install all the project dependencies:
$ npm installand then execute:
$ grunt testCompile plugin
Just execute:
$ grunt buildThis will generate two versions of the plugin in the dist folder.
1.0.0
11 years ago
