Lostfocus event in textbox

A

Annie

hello guys,

I am using asp.net 2 and I only can see it has got a textchanged event.

How can i implemnet the lostfocus event for a text in asp.net?
Any examples will be appreciated

thanks
 
R

recoil

Hello Annie.
If you wish to implement client-side javascript for this event then you
would need to use
txtDummy.Attributes.Add("onblur", "alert('losing focus');");

Hopefully you don't want to post back to the server whenever the user loses
focus. It is extremely annoying, and server resource consuming.

Hope this helps.
 
A

Annie

Thanks for your reply,

However, I was hoping to be able to do something in the server side actually
....
Because it requires some business rules and then need to do some
calculations based
on the value of two textboxes and then fill another textbox.

I didn't want to do all these in javascript ... ;(

Any other ways around this?

many thanks
 
M

mnichols

The suggestion given could still work for you just modify as follows:

txtDummy.Attributes.Add("onblur", "form1.submit();");

At the same time most users would be surprised by this behaviour. Is
there anyway to redesign your form with a 'submit' or 'evaluate' button
instead?

mn
 
A

Annie

Thanks for youre reply,
i think this is one of the alternatives ... and you are right the design
needs some changes ... coz this makes things very slow
many thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,125
Messages
2,570,748
Members
47,301
Latest member
SusannaCgx

Latest Threads

Top