Leave Page Alert "warning " Unless Submit Button Clicked I have a website where users submit application forms. The form is based on Entity forms.

How can I popup a message "warning" if user try to close browser without submitting the application.

something similar to this http://jsfiddle.net/DerekL/GSWbB/show/

Many thanks,
You can use the dirty forms module.

Currently there is only a drupal 6 version on the project page, however in this issue there is a drupal 7 version that apparently has been well tested and works.

With this module you can configure it to target your form using css seletors like classes and ids.