hello,
i have little proble
it's about adding two values from 2 textboxes and displays its value in 3rd textbox without clicking on any button or postbacks
I mean that once the user entered two numbers in two different text boxes, the summation should be added in the third one
my code is as follows
<script language ="javascript" type ="text/javascript" >
function adding()
{
var _txt1=document.getElementById ('<%=TextBox1.ClientID%>');
var _txt2=document.getElementById ('<%=TextBox2.ClientID%>');
var _txt3=document.getElementById ('<%=TextBox3.ClientID%>');
var t1=0, t2=0;
if(_txt1.value!="")
t1=_txt1.value;
if(_txt1.value!="")
t2=_txt2.value;
_txt3.value=parseInt(tl)+parseInt(t2);
}
</script>
enter first no.
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
<br />
enter second no.
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br />
<br />
result
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</asp:Content>
i know javascript function is not getting call bt when i write onkeyup="adding();" it gives an error that onkeyup is not valid....
help me