Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 25th, 2006, 11:52 AM
Registered User
 
Join Date: Oct 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to srikant_jan
Default Textbox

I am having three text box t1,t2 and t3. The results of t1+12 has to be shown in t3 when ever i am changing either t1 or t2. I tried doing it by handling text changed event but it works when i take away the focus from either t1 or t2 and secondly it gets focused back to either t1 or t2. How can i do the online changes made to t1 or t2 would reflect in t3 by adding it.

Janamanchi Shrikanth N R
 
Old November 10th, 2006, 06:04 AM
Skb Skb is offline
Authorized User
 
Join Date: Oct 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

u can try the following.

code behind:
------------
t1.attributes.add("onkeypress","Calculate(this)");
t2.attributes.add("onkeypress","Calculate(this)");

Javascript:
------------
function Calculate(obj)
{
   var val1 = document.getElementById("t1").value;
   var val2 = document.getElementById("t2").value;
   var val3 = val1 + val2;
   document.getElementById("t3").value = val3;
}






Similar Threads
Thread Thread Starter Forum Replies Last Post
TextBox Help iceman90289 C# 2005 6 April 6th, 2008 03:54 AM
pointing cursor from one textbox to other textbox lakshmi_annayappa ASP.NET 1.0 and 1.1 Basics 2 August 2nd, 2007 03:41 PM
Textbox deontae45 VB.NET 2002/2003 Basics 1 September 25th, 2006 11:26 AM
Masked TextBox & formatting TextBox melvik C# 1 September 22nd, 2003 11:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.