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

imo validator

Validate an IMO (International Maritime Organization)

Validators

Options

Option HTML attribute Type Description
message data-fv-imo-message String The error message
When setting options via HTML attributes, remember to enable the validator by setting data-fv-imo="true".
The message option can be updated on the fly via the updateMessage() method

Example

<form id="imoForm" class="form-horizontal">
    <div class="form-group">
        <label class="col-xs-3 control-label">IMO</label>
        <div class="col-xs-5">
            <input type="text" class="form-control" name="imo" />
        </div>
    </div>
</form>

<script>
$(document).ready(function() {
    $('#imoForm').formValidation({
        framework: 'bootstrap',
        icon: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            imo: {
                validators: {
                    imo: {
                        message: 'The value is not valid IMO'
                    }
                }
            }
        }
    });
});
</script>
<form id="imoForm" class="form-horizontal"
    data-fv-framework="bootstrap"
    data-fv-icon-valid="glyphicon glyphicon-ok"
    data-fv-icon-invalid="glyphicon glyphicon-remove"
    data-fv-icon-validating="glyphicon glyphicon-refresh">

    <div class="form-group">
        <label class="col-xs-3 control-label">IMO</label>
        <div class="col-xs-5">
            <input type="text" class="form-control" name="imo"
                data-fv-imo="true"
                data-fv-imo-message="The value is not valid IMO" />
        </div>
    </div>
</form>

<script>
$(document).ready(function() {
    $('#imoForm').formValidation();
});
</script>