Validate

The plugin is a wrapper for the jQuery Validation plugin. It changes some default options to make the validation output compatible with Bootstrap's markup.

The plugin requires the jQuery Validation plugin included.

Basic

For proper positioning of error messages, you need to add the .form-help-text class to an each help block of the form.
Example block-level help text here.
Example block-level help text here.
Example block-level help text here.

Initializing

PxValidate plugin is initialized on pre-existing markup.

Options can be passed via data attributes or JavaScript. For data attributes, append the option name to data-, for example: <form method="POST" action="" data-wrapper="li">.

$('form').pxValidate(jqueryValidationOptions);
        

Usage


require(['jquery', 'px/plugins/px-validate'], function($) {
  ...
});