I have a field in the format text
:
<input type="text" name="base_calculo" id="base_calculo">
I would like you to fill in this field by adding the% symbol at the end of it and typing the field like this: 0.0%
Thank you!
I have a field in the format text
:
<input type="text" name="base_calculo" id="base_calculo">
I would like you to fill in this field by adding the% symbol at the end of it and typing the field like this: 0.0%
Thank you!
The function does not only block number in this field
$('#base_calculo').on('blur', function(){
var valor = $(this).val();
valor = valor.replace(',','.');
if(!$.isNumeric(valor)) return;
valor += '%';
$(this).val(valor);
});