tbsolutions
asked on
Javascript Currency Mask for Asp.Net
My page has a textbox that uses a javascript currency mask function, the mask works fine. TextBox AutoPostBack property is enabled, but the only key that calls the "PostBack" to start the "onTextChanged" event is the "Enter". I need to call the "PostBack/onTextChanged" when the field loose it's focus (not only pressing "Enter" but for example with "Tab" or simply clicking out). I tried to remove the mask, and everything worked. I don't know if the problem is the script function or the page behavior.
Remove the return false at the end of the MascaraMoeda function
ASKER
The textbox keeps responding only when you press "Enter".
Sorry, remove the return in onkeypress too
Like this :
<asp:TextBox ID="txtValorStrike" onkeypress="MascaraMoeda(this,'.',',',event)" CssClass="TextBoxCommon" runat="server" Width="134px" AutoPostBack="True" OnTextChanged="txtValorStrike_TextChanged"></asp:TextBox>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That's it! Thanks.
You're welcome! Thanks for the points!