Solved

ASP.NET, .NET 2.0, textbox "lost focus" help needed...

Posted on 2006-11-14
2
814 Views
Last Modified: 2013-11-25
Hi all,
I'm having trouble finding an answer and hope you can help.

I have an ASP.NET form (using VS 2005 and .NET 2.0) that has 3 textboxes on it.  I want to be able to add the value of textbox1 to the value of textbox2 and add it to textbox3 on the client side without a trip to the server.

Can you provide a snippet of code that shows how to do something like this?

Thanks,
Terry
0
Comment
Question by:colepc
2 Comments
 
LVL 6

Accepted Solution

by:
badalpatel earned 500 total points
ID: 17944968
u have to write this script

<script language="javascript" type="text/javascript">
function summation()
{
    document.getElementById("textbox3").value = (document.getElementById("textbox1").value)/1 + (document.getElementById("textbox2").value)/1
}
</script>

and on aspx.vb u have to just call this script function like

textbox1.Attributes.Add("onchange", "javascript:summation()")
        textbox2.Attributes.Add("onchange", "javascript:summation()")
0
 

Author Comment

by:colepc
ID: 17947407
Thanks!  That worked great.  Can you point me to a web reference for where I can learn more about what "attributes" are possible.  For example, you show an "onchange" event attribute.  I'd like to explore more of those.

Thanks again for your solution.

Terry
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now