1
I implemented the jQuery plugin for masks in form fields developed by Igor Escobar, it is working correctly, but it occurs that when entering numerical values from 1 to 99 take the focus of the field, values from 1 to 99 do not complete the decimal with ".00", some hint of implementation of this possibility in the code?
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.16/jquery.mask.min.js"></script>
<input type='text' class='money'>
<input type='text' class='money'>
$(document).ready(function(){
$('.money').mask('000.000.000.000.000,00', {reverse: true});
});
$(document).ready(function(){
$('.money').mask('000.000.000.000.000,00', {reverse: true});
});
input.money
{
font-size: 12px;
padding: 6px;
min-width: 100px;
color: #000;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.16/jquery.mask.min.js"></script>
<input type='text' class='money'>
<input type='text' class='money'>
hi, I searched the documentation, and my doubt and that of other users are open on the github in his profile, has the callbacks but is not resulting in anything this.
– ElvisP
Okay, I recommend using another library, because I’ve been through at least one problem in this library and what I’ve done is change, I’ll see if I can find the one I used and pass it to you
– Azzi
There’s an error there in the code, "if($(". money"). val(). length <= 2){ ", then it will take all fields with the class and results in nothing, it would have to be " if($(this). val(). length <= 2){ "
– ElvisP
Thank you for correcting!
– Azzi
https://drive.google.com/file/d/1JyW2KjplXYBkIpCiEhCfN9WrLr0KJxeA/view?usp=sharing Here you are, I hope to help! Good luck
– Azzi
gratitude, needed it badly.
– ElvisP