Hi,
I have 3 TextBox (TextBox1, TextBox2, TextBox3)
If I give the velue in TextBox1 and TextBox2 then the sum result is displayed in TextBox3. I am doing this in javascript code. Codes are working nicely
But if I add them inside a Teb Container then it does not works.
I cant understand what is the problem?
Can any one to help me.
[I am using Asp.Net]
Thanks in advance
Rashed
My Code is like this
<script type="text/javascript">
function ChangeAmountBooking() {
var SigningMoney = parseFloat(document.getElementById('TextBox1').value);
if (document.getElementById('TextBox1').value == '') {
SigningMoney=0;
}
var HouseRentPerpose = parseFloat(document.getElementById('TextBox2').value)
if (document.getElementById('TextBox2').value == '') {
HouseRentPerpose = 0;
}
document.getElementById('TextBox3').value = SigningMoney+HouseRentPerpose;
}
</script>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<br />
<br />
<cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0"
Width="850px">
<cc1:TabPanel runat="server" HeaderText="TabPanel1" ID="TabPanel1">
<ContentTemplate>
<table>
<tr>
<td>
TextBox1</td>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
TextBox2</td>
<td>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
TextBox3</td>
<td>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
</table>
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="TabPanel2">
<ContentTemplate>
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
CS Page Code
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
TextBox1.Attributes.Add("onblur", "javascript:return ChangeAmountBooking()");
TextBox2.Attributes.Add("onblur", "javascript:return ChangeAmountBooking()");
}
}