The case goes like this I have 4 textbox the dynamic is the following textbox1 + textbox2 + textbox 3 = textbox4. When entering the numbers in the textbox, I would like to give it the following format:
NOW: 123456789 WANTED: 123,456,789.00
function agregar_numero() {
var TextBox1 = parseInt(document.getElementById("txtremubruta").value);
var TextBox2 = parseInt(document.getElementById("txtotrosingresos").value);
var TextBox3 = parseInt(document.getElementById("txtremubrutamensual").value);
var result = TextBox1 + TextBox2 + TextBox3;
document.getElementById("TxtInfoPatriTotal").value = result;
}
<form runat="server">
<asp:TextBox ID="txtremubruta" runat="server" CssClass="TextBoxBorder" Width="70px" onkeyup="agregar_numero()"></asp:TextBox>
<asp:TextBox ID="txtotrosingresos" runat="server" CssClass="TextBoxBorder" Width="70px" onkeyup="agregar_numero()"></asp:TextBox>
<asp:TextBox ID="txtremubrutamensual" runat="server" CssClass="TextBoxBorder" Width="70px" onkeyup="agregar_numero()"></asp:TextBox>
<br> Total
<br>
<asp:TextBox ID="TxtInfoPatriTotal" runat="server" CssClass="TextBoxBorder" Width="70px"></asp:TextBox>
</form>