programer.tips, another cool thing from @nghuuphuoc!

digits validator

Return true if the value contains only digits

Validators

Improve it on Github

Options

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

Related validators

The following validators might be useful to you: