1.1.2 • Published 6 years ago

oyi-ajax-forms v1.1.2

Weekly downloads
5
License
ISC
Repository
gitlab
Last release
6 years ago

Oyi Ajax Forms

The jQuery Validation and Ajax Plugin provides drop-in validation for your existing forms, while making all kinds of customizations to fit your application really easy.

Usage

  • npm install oyi-ajax-forms --save
  • import 'oyi-ajax-forms'; or
  • use <script>

Initialization

const subscribeForm = new OyiForms($('#subscribe-form'), { options });

Options

{
	validate: {
		// input error class
		errorClass: 'input-error',
		// input parent wrapper element (e.g. 'fieldset')  
		parentElement: 'div',
		// element for error message  
		errorElement: 'div',
	},
	ajax: {
		// type of ajax request
		dataType: 'json'
	},
	// before send cb
	beforeSend: (arr, form) => {},
	// after send cb function  
	onSuccess: (form, response) => {},
	// owerwrite default messages
	e.g. messages: {required: 'Поле є повинне бути заповненим'}
	messages: {}
} 
1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago