Connecting Tech Pros Worldwide Forums | Help | Site Map

Onblur event, javascript

Newbie
 
Join Date: Jun 2007
Posts: 3
#1: Oct 17 '08
hi
i have attached onblur event to document body. but at run time when i move out of one text box to another text box in that doc its not firing the event.
please help

acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: Oct 17 '08

re: Onblur event, javascript


Post your code. Try attaching the event to the text box.
Newbie
 
Join Date: Jun 2007
Posts: 3
#3: Oct 17 '08

re: Onblur event, javascript


Quote:

Originally Posted by acoder

Post your code. Try attaching the event to the text box.

i have lots of elements in the document which was loaded in an IFrame

how? help me out
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#4: Oct 17 '08

re: Onblur event, javascript


If you want it to trigger on the text box losing focus, you need to attach/add it to each text box.
RamananKalirajan's Avatar
Needs Regular Fix
 
Join Date: Mar 2008
Location: Chennai - India
Posts: 350
#5: Oct 17 '08

re: Onblur event, javascript


Quote:

Originally Posted by chiru

i have lots of elements in the document which was loaded in an IFrame

how? help me out

The reason why you are not getting the result is the whole body is taken as a object. Once u click a child or focus on a child after clicking the body ur code will be working the reason is the body loses its focus. You cant expect this logic to be working perfect as per ur requirement. The best way is adding the function call on onfocus of every object or onblur of every object. If u have any doubts post it back. All the best.

Regards
Ramanan Kalirajan
Reply