We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

"Lost Focus" event on web form text box

EugeneC
EugeneC asked
on
Medium Priority
1,079 Views
Last Modified: 2012-08-13
Hi

Is is possible to handle a "lost focus" event on a web form text box in c#?
Comment
Watch Question

Commented:
apologies... that tutorial is for regular forms.
It is possible however, but i read that you have to capture the exitFocus event of the input box... I will try and track down the page again.
Software Architect
CERTIFIED EXPERT
Top Expert 2005
Commented:
Hi SmithJW,

you can do it by following way.

<script language="javascript">
function LFocus()
{
    alert("test");
}
</script>

<asp:textbox id="txttest" onblur ="javascript:LFocus()"></asp:textbox>


Regards,
NetSwap

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Thank you for that but is there anyway I can hook up the Javascript so I can handle code behind functions.

Author

Commented:
Ideally I need to capture the "loose focus" event so that it runs a c# code behind function.

Author

Commented:
Could anyone suggest an alternative approach - I need to capture the "loose focus" event on a c# web form
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.