0
I have a field in shape text
:
<input type="text" name="base_calculo" id="base_calculo">
I would like you to add the % symbol at the end of this field and format the field like this: 0.0%
Thank you!
0
I have a field in shape text
:
<input type="text" name="base_calculo" id="base_calculo">
I would like you to add the % symbol at the end of this field and format the field like this: 0.0%
Thank you!
1
The function does not lock only number in that field
$('#base_calculo').on('blur', function(){
var valor = $(this).val();
valor = valor.replace(',','.');
if(!$.isNumeric(valor)) return;
valor += '%';
$(this).val(valor);
});
Didn’t work out....
It only gives if I click out... I would like when clicking on the field it already added the % and as it fills, put the . certinho
Use the mask money and in the mask I put decimal 1 and have the option there to put a character not remember well
Browser other questions tagged jquery
You are not signed in. Login or sign up in order to post.
You have already tried using the plugin jQuery-Mask-Plugin?
– Jeferson Assis
I would not like to use a plugin, is this field only... and when filling will see stay 2.5% or if only add the % in the field by jquery, would be good..
– Sr. André Baill
http://stackoverflow.com/questions/11613642/mask-input-with-percent-sign
– Daniel Omine