Jump to content

Warning Message on Navigate Away - Noob Question


tr0y

Recommended Posts

Hi noob here coming from a business analyst background and trying to become more useful to developers. Please bear with me. 

 

I am working on the functional specifications of a web application ( PHP / MySQL )  that allows users to upload large quantities of files in bulk using plupload, sometimes numbering into the thousands of files. 

 

What I am trying to learn and understand is how to warn a user if they click any other link on the page, internal or external, that the upload may fail and that they should not navigate away. 

 

I have been able to warn them if they are going to close the window or tab, but not if they are going to click a link on the page. 

 

I have attached a screenshot with the warning dialog when you close the page but am trying to pop that up with the click of any link on that page. 

 

This may not be the right forum for this question, sorry for my noobishness if this is an the wrong place. 

 

Thanks ! 

post-168191-0-34313700-1395591300_thumb.jpg

  • 3 weeks later...

<script>
$(document).ready(function() {
   $("a").click(function(e) {
     e.preventDefault;
      var c = confirm('If you leave your upload may fail.');
        if (c == false) return false;
   });
});
</script>
 

This will alert on any link clicked on the page and if they click ok they will be able to follow the link or if they click cancel it won't do anything.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.