programer.tips, another cool thing from @nghuuphuoc!

issn validator

Validate an ISSN (International Standard Serial Number)

Validators

Improve it on Github

Options

Option HTML attribute Type Description
message data-bv-issn-message String The error message
When setting options via HTML attributes, remember to enable the validator by setting data-bv-issn="true".

Example

ISSN Result
0378-5955
0024-9319
0032-1478
0032-147X
<form id="issnForm" class="form-horizontal">
    <div class="form-group">
        <label class="col-sm-3 control-label">ISSN</label>
        <div class="col-sm-5">
            <input type="text" class="form-control" name="issn" />
        </div>
    </div>
</form>
$(document).ready(function() {
    $('#issnForm').bootstrapValidator({
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            issn: {
                validators: {
                    issn: {
                        message: 'The value is not valid ISSN'
                    }
                }
            }
        }
    });
});

Related validators

The following validators might be useful to you: