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

isbn validator

Validate an ISBN (International Standard Book Number). Support both ISBN 10 and ISBN 13

Validators

Options

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

Example

<form id="isbnForm" class="form-horizontal">
    <div class="form-group">
        <label class="col-xs-3 control-label">ISBN</label>
        <div class="col-xs-5">
            <input type="text" class="form-control" name="isbn" />
        </div>
    </div>
</form>

<script>
$(document).ready(function() {
    $('#isbnForm').formValidation({
        framework: 'bootstrap',
        icon: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            isbn: {
                validators: {
                    isbn: {
                        message: 'The value is not valid ISBN'
                    }
                }
            }
        }
    });
});
</script>
<form id="isbnForm" 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">ISBN</label>
        <div class="col-xs-5">
            <input type="text" class="form-control" name="isbn"
                data-fv-isbn="true"
                data-fv-isbn-message="The value is not valid ISBN" />
        </div>
    </div>
</form>

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

Related validators

The following validators might be useful to you: