I'm creating a mask in my field like this:
$("#ValorMultaSt").mask('000.000.000,00', { reverse: true });
When I type some value works perfectly, however when I perform any action on the screen it puts a "." on the front, as in the example:
If I type 444,44
after performing an action on screen the value is changed to .444,44
javascript function:
function AtualizarMascaras() {
// Mascaras
$("#ValorPorcentagemField").mask('000', { reverse: true });
$("#ValorMultaSt").mask('000.000.000,00', { reverse: true });
$("#ValorMultaAcrescimoSt").mask('000.000.000,00', { reverse: true });
$("#ValorMultaFaixaMinimaSt").mask('000.000.000,00', { reverse: true });
$("#ValorMultaFaixaMaximaSt").mask('000.000.000,00', { reverse: true });
$("#DataPublicacao").mask('00/00/0000');
}
Function that calls the Refresh Mask function:
$(function () {
$(document).ajaxComplete(function () {
AtualizarMascaras();
});
AtualizarMascaras();
});
Div field html:
<div class="row" id="divValorMulta">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<div class="form-group">
<div class="row">
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
@Html.LabelFor(model => model.ValorMultaSt, "Valor da Multa")
</div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
@Html.EditorFor(model => model.ValorMultaSt, new { htmlAttributes = new { @class = "form-control", disabled, @placeholder = "R$" } })
</div>
</div>
</div>
</div>
</div>
Can anyone help me?