Click here to Skip to main content
15,886,075 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
HI friends,i want the t1,t2,t3 controls in server side for further coding.
Also viceversa

Quote:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<script type="text/javascript">
function nims() {

var a = parseFloat(document.form1.t1.value);
var b =parseFloat(document.form1.t2.value);
var sum = a + b;
document.form1.t3.value = sum;
}
</script>

<title> </title>
</head>
<body>
<form id="form1" runat="server">

<input type="text" value="0" name="t1" onkeyup="nims();" />
<input type="text" value="0" name="t2" onkeyup="nims();"/>
<input type="text" value="0" name="t3" />  

</form>
</body>
</html>
Posted

1 solution

hi..

use runat="server" property for each control
 
Share this answer
 
Comments
Nimisha Mary John 12-Apr-12 5:48am    
ok,then how can we call this to .cs page?
i tried like below,but failed:
TextBox tx =(TextBox)FindControl("txt1");
Pravinjas 13-Apr-12 1:33am    
give id to input control

<input type="text" id="text1" value="0" name="t1" önkeyup="nims();" />


then in cs file access that ID

like text1.text="whatever u want";
Nimisha Mary John 13-Apr-12 2:38am    
hello friend,Just try it out before answering;
Pravinjas 13-Apr-12 8:00am    
<input type="text" runat="server" id="text1" value="0" name="t1" önkeyup="nims();" />

text1.Value = "ur text";

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900