I would like to validate decimals with a comma, or how to add a comma to the allowed characters with this validation, I could validate integers but not decimals (with a comma)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input class="enteros" type=text />
<input class="decimales" type=text />
$(function () {
$('.enteros').on('input', function () {
this.value = this.value.replace(/[^0-9]/g, '');
});
});
$(function () {
$('.decimales').on('input', function () {
this.value = this.value.replace(/[^0-9]/g, '');
});
});