Skip to content

gburgose/jquery-formulator

Repository files navigation

jQuery Formulator

Installation

Dependencies

NPM

npm install jquery-formulator --save-dev

Install plugin and all dependencies

npm install jquery-formulator jquery-validation@1.16.0 jquery-form@4.2.0 jquery.rut@1.1.2 sweetalert@1.1.3 --save-dev

Webpack

require('jquery-formulator');

jQuery

$(document).ready(function(){
  $('form').formulator();
});

HTML

Validation

You must add the class .form-validate

<form action="" class="form-validate">
	...
	<input type="text" name="firstname">
</form>

Add this to show form errors

<div class="form-errors"></div>
Ajax

You must add the class .form-ajax

<form action="" class="form-ajax">
	...
	<input type="text" name="firstname">
</form>
Both

Example with both classes

<form action="" class="form-ajax form-validate">
	...
	<input type="text" name="firstname">
</form>