Validators / isbn

Edit on Github

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

Option Equivalent HTML attribute Type Description
message data-bv-isbn-message String The error message

Example

ISBN Result
9971502100
99921-58-10-7
960 425 059 0
99921-58-10-6
9780306406157
978-0-306-40615-7
978 0 306 40615 7
978-0-306-40615-6
<form id="isbnForm" class="form-horizontal">
    <div class="form-group">
        <label class="col-lg-3 control-label">ISBN</label>
        <div class="col-lg-5">
            <input type="text" class="form-control" name="isbn" />
        </div>
    </div>
</form>
<script>
$(document).ready(function() {
    $('#isbnForm').bootstrapValidator({
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            isbn: {
                validators: {
                    isbn: {
                        message: 'The value is not valid ISBN'
                    }
                }
            }
        }
    });
});
</script>

Comments

If you want to report a bug, please submit the issue on Github. Do NOT post the issue here.

For a general question or feedback, use the form below.