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

greaterThan validator

Return true if the value is greater than or equals to given number

Validators

Options

* — Required option

Option HTML attribute Type Description
inclusive data-fv-greaterthan-inclusive Boolean Can be true or false.
If true, the input value must be greater than or equal to the comparison one.
If false, the input value must be greater than the comparison one
message data-fv-greaterthan-message String The error message. The dynamic message is supported
value* data-fv-greaterthan-value Float The number to make a comparison to.
It's a dynamic option
When setting options via HTML attributes, remember to enable the validator by setting data-fv-greaterthan="true".
You don't need to do that when using HTML 5 min="..." attribute.
The message and other options can be updated on the fly via the updateMessage() and updateOption() methods

If you want the value to support custom format, such as a comma for thousand separator, you should use the transformer option. The modifying the value before validating example is good starting point.

Example

<form id="profileForm" class="form-horizontal">
    <div class="form-group">
        <label class="col-xs-5 control-label">Your age (18+ required)</label>
        <div class="col-xs-5">
            <input type="text" class="form-control" name="age" />
        </div>
    </div>
</form>

<script>
$(document).ready(function() {
    $('#profileForm').formValidation({
        framework: 'bootstrap',
        icon: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            age: {
                validators: {
                    greaterThan: {
                        value: 18,
                        message: 'The value must be greater than or equal to 18'
                    }
                }
            }
        }
    });
});
</script>
<form id="profileForm" 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-5 control-label">Your age (18+ required)</label>
        <div class="col-xs-5">
            <input class="form-control" type="text" name="age"
                   data-fv-greaterthan="true" />
                   data-fv-greaterthan-value="18" />
                   data-fv-greaterthan-message="The value must be greater than or equal to 18" />
        </div>
    </div>
</form>

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

Related validators

The following validators might be useful to you: