SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: onblur issue

  1. #1
    SitePoint Member
    Join Date
    May 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    onblur issue

    I've got an input field and I'm using the onblur event handler to call a method that does some validation when the input field loses focus.
    Thats fine but if the user closes the window then onblur is calling that method to do the validation, which I dont want, if they close the window I would like the window to close without onblur calling that method.
    How could I do this ?

  2. #2
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by garyt View Post
    I've got an input field and I'm using the onblur event handler to call a method that does some validation when the input field loses focus.
    Thats fine but if the user closes the window then onblur is calling that method to do the validation, which I dont want, if they close the window I would like the window to close without onblur calling that method.
    How could I do this ?
    I assume you are trying to avoid showing an unnecessary alert box. Unless the warning is done in an unobtrusive way, validating with the blur event is not advisable.
    Tab-indentation is a crime against humanity.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    or you can write a adUnloadListener function, that removes the onblur even listener from the input before the page woul unload itself..


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •