0
Good afternoon guys, I’m having a problem using the maskMoney plugin from jQuery. I am using the following statement before
<div style="float:left; width: 25%">
<asp:Label ID="Label24" runat="server" Text="Valor Total: "></asp:Label>
<asp:RequiredFieldValidator ID="rfvValTotalEnsinoSuperior" runat="server" ErrorMessage="Valor Total: Campo obrigatório." ControlToValidate="tbValorTotalEnsinoSuperior" Display="Dynamic" Text="*" ValidationGroup="ParteReembolsoEnsinoSuperior" ForeColor="Red" SetFocusOnError="True"></asp:RequiredFieldValidator>
<br />
<asp:TextBox ID="tbValorTotalEnsinoSuperior" Size="25%" runat="server" MaxLength="100" ReadOnly="True"></asp:TextBox>
<br /><br />
</div>
$("[id*=tbValorTotalEnsinoSuperior]").maskMoney({ prefix: 'R$ ', thousands: '.', decimal: ',' });
E em minha função tenho:
$("[id*=tbValorTotalEnsinoSuperior]").maskMoney('mask',0.01);
But in Textbox he puts the value as R $ 1,00 instead of R $ 0,01
Anyone can help?
Your code seems to work normally. It may be something else influencing.
– Sam
Try placing the value between comma quotes:
$("[id*=tbValorTotalEnsinoSuperior]").val("0,01");
– Sam
Try to change the culture of your application, maybe you are using different culture than en-BR.
– Matheus Miranda
The strange thing is that if in the mask I change the order of '.'(point) and ','(comma) it displays the correct value R$0.01 but with the comma in front it continues displaying R$1.00
– Philipe Matheus