Hi I have a form and on one input field I set a blur event. A user leaves the input field, I validate it and then I decide if it is okay. If the value of the field is not okay I am alerting an information box. Anyway if the user hits a link to leave the page I cannot stop him. If a link is clicked by the user I have to prevent the default behaviour. How do I recognize by what event user has left the input field? Thanks in advance.
Share
Have a look at this http://api.jquery.com/unload/
As they says in the doc
You can use this event to prevent users from navigating away from the page.
Like this