, another cool thing from @nghuuphuoc!

stringCase validator

Check if a string is a lower or upper case one


Improve it on Github


Option HTML attribute Type Description
case data-bv-stringcase-case String Can be lower default or upper
message data-bv-stringcase-message String The error message
When setting options via HTML attributes, remember to enable the validator by setting data-bv-stringcase="true".


The following form asks user to enter a credit card holder in uppercase:

<form id="stringCaseForm" class="form-horizontal">
    <div class="form-group">
        <label class="col-sm-4 control-label">Credit card holder</label>
        <div class="col-sm-4">
            <input type="text" class="form-control" name="name" />
$(document).ready(function() {
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        fields: {
            name: {
                validators: {
                    stringCase: {
                        message: 'The card holder must be in uppercase',
                        'case': 'upper'