programer.tips, another cool thing from @nghuuphuoc!

isin validator

Validate an ISIN (International Securities Identification Number)

Validators

Improve it on Github

Options

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

Example

ISIN Result
US0378331005
AU0000XVGZA3
GB0002634946
US0378331004
AA0000XVGZA3
<form id="isinForm" class="form-horizontal">
    <div class="form-group">
        <label class="col-sm-3 control-label">ISIN</label>
        <div class="col-sm-5">
            <input type="text" class="form-control" name="isin" />
        </div>
    </div>
</form>
$(document).ready(function() {
    $('#isinForm').bootstrapValidator({
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            isin: {
                validators: {
                    isin: {
                        message: 'The value is not valid ISIN'
                    }
                }
            }
        }
    });
});

Related validators

The following validators might be useful to you: