Jump to content

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.

Edited by Skewled
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.