Use with the Mask plugin.
<!-- Include Mask plugin -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.10.3/jquery.mask.min.js"></script>
<form id="maskForm" method="post" class="form-horizontal">
<div class="form-group">
<label class="col-lg-3 control-label">IP address</label>
<div class="col-lg-5">
<input type="text" class="form-control" name="ipAddress" />
</div>
</div>
</form>
$(document).ready(function() {
$('#maskForm')
.bootstrapValidator({
feedbackIcons: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
ipAddress: {
validators: {
ip: {
message: 'The IP address is not valid'
}
}
}
}
})
.find('[name="ipAddress"]').mask('099.099.099.099');
});