Solved

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

Posted on 2006-11-14
2
800 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
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 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

17 Experts available now in Live!

Get 1:1 Help Now