[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2006-11-14
2
Medium Priority
?
854 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
badalpatel earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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 video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

650 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