Basit Khan

Basit Khan

  • 1.3k
  • 336
  • 115.5k

Calculation need in javascript

Dec 5 2016 12:05 PM
Hi,
 
I want the calculation in javascript.
 
Below is my code in .net
 
ASP Code
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style1
{
width: 100%;
}
.style2
{
width: 128px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table class="style1">
<tr>
<td class="style2">
<asp:Label ID="Label1" runat="server" Text="Total Amount"></asp:Label>
</td>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style2">
<asp:Label ID="Label2" runat="server" Text="Discount Percent"></asp:Label>
</td>
<td>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style2">
<asp:Label ID="Label3" runat="server" Text="Toatl % Amount"></asp:Label>
</td>
<td>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td>
<asp:Button ID="Button1" runat="server" Text="Calculate" />
</td>
</tr>
<tr>
<td class="style2">
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Below is code behind
 
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
TextBox3.Text = TextBox1.Text * TextBox2.Text / 100
End Sub
 
i want above code behind code in javascript.
 
Thanks
Basit. 

Answers (3)