jquery.validate-mini

1.0.0 • Public • Published

JQUERY validateMini

mini js script for form validation. You can add new custom and use it very easy.

Getting Started

this script help you validate data in frontend before submit data for backend.

Demo: https://huyn03.github.io/jquery.validateMini/

Prerequisites

JQUERY
jquery.validateMini

Installing

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

and

<script src="assets/js/jquery.validateMini.min.js></script>

Running the tests

Html

<form>
    <div class="form-group">
        <label>Username</label>
        <input validates="required|test:3,6" name="username" type="text" class="form-control" value="">
    </div>
    <div class="form-group">
        <label>Password</label>
        <input validates="required|between:6,15|strong" id="Password" name="password" type="password" class="form-control" value="">
    </div>
    <input type="submit" name="" value="send" class="form-control">
</form>

JavaScript

$('form').validateMini({
	validates: {
		test: (params, value)=> {
			return `Params of valid test: ${params[0]} and ${params[1]}`;
		},
		strong: (params, value)=>{
			return /^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])/.test(value) || "Yêu cầu chữ cái, số, in hoa và ký tự"
		},
	}

});

Built With

  • JQUERY - The javascript framework used

Authors

Đinh Thanh Huy DrHuy

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

Package Sidebar

Install

npm i jquery.validate-mini

Weekly Downloads

2

Version

1.0.0

License

ISC

Unpacked Size

10.7 kB

Total Files

5

Last publish

Collaborators

  • huyn03