FormValidation v0.8.1 is released, supports Bootstrap 4 alpha 3

Playing with selectize


This example shows how to use FormValidation with the selectize plugin.

You should look at the basic principles when integrating FormValidation with other plugins

The form asks you to put 2-4 favorite Javascript frameworks.

<link rel="stylesheet" href="//" />
<link rel="stylesheet" href="//" />
<script src="//"></script>

<style type="text/css">
#selectizeForm .frameworkContainer .form-control-feedback {
    right: -15px;

<form id="selectizeForm" method="post" class="form-horizontal">
    <div class="form-group">
        <label class="col-xs-4 control-label">Favorite frameworks</label>
        <div class="col-xs-6 frameworkContainer">
            <input class="form-control" name="frameworks" />

    <div class="form-group">
        <div class="col-xs-6 col-xs-offset-4">
            <button type="submit" class="btn btn-default">Submit</button>

$(document).ready(function() {
            framework: 'bootstrap',
            excluded: ':disabled',
            icon: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            fields: {
                frameworks: {
                    validators: {
                        callback: {
                            message: 'Please indicate 2-4 Javascript frameworks',
                            callback: function(value, validator, $field) {
                                // Get the frameworks separated by a comma
                                var frameworks = validator.getFieldElements('frameworks').val().split(',');
                                return (frameworks.length >= 2 && frameworks.length <= 4);
                plugins: ['remove_button'],
                delimiter: ',',
                persist: false,
                create: function(input) {
                    return {
                        value: input,
                        text: input
            // Revalidate the frameworks field when it is changed
            .on('change', function(e) {
                $('#selectizeForm').formValidation('revalidateField', 'frameworks');