In my asp.net website I am trying to multiply two textbox value and store it into another textbox. But, my piece of code is not working
The JS:
<script language="javascript">
function myFunction(x)
{
var x = document.getElementById("<%=u_price1.ClientID %>") * document.getElementById("<%=qty1.ClientID %>");
return x;
}
</script>
Textboxes:
<asp:TextBox ID="u_price1" runat="server" Width="63px" CssClass="txt1">0</asp:TextBox>
<asp:TextBox ID="qty1" runat="server" Width="63px" CssClass="txt1">0</asp:TextBox>
<asp:TextBox ID="amt1" runat="server" Width="81px" CssClass="txt1" onfocus="myFunction(this)"></asp:TextBox>
Please tell me whats wrong I am doing here.