Skip to content

Settings

albertmoreno edited this page Sep 30, 2015 · 9 revisions

The package works out of box with default settings if you are using Bootstrap

When the JsValidator is rendered without specify selector or view, this values are loaded from package config. You can customize some options modifying the config/jsvalidation.php file

    /**
     * Default view used to render Javascript validation code
     */
    'view' => 'jsvalidation::bootstrap',

    /**
     * Default JQuery selector find the form to be validated.
     * By default, the validations are applied to all forms.
     */
    'form_selector' => 'form',

    /*
     * Enable or disable Ajax validations of Database and custom rules.
     * By default Unique, ActiveURL, Exists and custom validations are validated via AJAX
     */
    'disable_remote_validation' => false,
Parameters
view

The view parameter specifies the view that will be loaded by default when the validator is rendered.

This view is responsive to generate the javascript needed to validate the form. By default, Bootstrap compatible view is provided. In any case you can can customize this view or create new one.

form_selector

The form_selector parameter specifies the default jQuery selector used to find the form element to validate.

By default, form is selected, so the validations will be applied to all forms present in HTML page

disable_remote_validation

The disable_remote_validation parameter allows disable Ajax validations from Unique, ActiveURL, Exists and custom validations rules

Clone this wiki locally