Onblur event, javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chiru
    New Member
    • Jun 2007
    • 3

    #1

    Onblur event, javascript

    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
    Recognized Expert MVP
    • Nov 2006
    • 16032

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

    Comment

    • chiru
      New Member
      • Jun 2007
      • 3

      #3
      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

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        If you want it to trigger on the text box losing focus, you need to attach/add it to each text box.

        Comment

        • RamananKalirajan
          Contributor
          • Mar 2008
          • 608

          #5
          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

          Comment

          Working...