, another cool thing from @nghuuphuoc!

Using Ajax to submit the form


Improve it on Github

By triggering the event, we can use Ajax to submit the form data.

$(document).ready(function() {
            ... options ...
        .on('', function(e) {
            // Prevent form submission

            // Get the form instance
            var $form = $(;

            // Get the BootstrapValidator instance
            var bv = $'bootstrapValidator');

            // Use Ajax to submit form data
            $.post($form.attr('action'), $form.serialize(), function(result) {
                // ... Process the result ...
            }, 'json');

In the example above, you can see the form is prevented from doing default submission by using