<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:#20124d">It worked for me too.</div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:#20124d"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif;font-size:small;color:#20124d">Thank you so much.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 25, 2014 at 9:22 PM, Andrew Martin <span dir="ltr">&lt;<a href="mailto:amartin@xes-inc.com" target="_blank">amartin@xes-inc.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">----- Original Message -----<br>
&gt; From: &quot;Gray D. McCord&quot; &lt;<a href="mailto:gdm@sangabriel.com">gdm@sangabriel.com</a>&gt;<br>
&gt; To: &quot;ZendTo Users&quot; &lt;<a href="mailto:zendto@zend.to">zendto@zend.to</a>&gt;<br>
</span><span class="">&gt; Sent: Tuesday, November 25, 2014 4:40:55 PM<br>
&gt; Subject: [ZendTo] Re: &quot;Leave This Page&quot; warning when dropping off a file<br>
&gt;<br>
</span><div><div class="h5">&gt; I ran into this quite a while back. I have two possible things you can try.<br>
&gt; Both involve edits to the new_dropoff.tpl file:<br>
&gt; SOLUTION 1:<br>
&gt; First, my solution, which works for me is to edit the submitform() script in<br>
&gt; the new_dropoff.tpl file by setting &quot;ignore_upload = true;” in the submit<br>
&gt; form script and my problem went away. Now, my Zendto is highly customized<br>
&gt; with a JS file uploader and php5.5, so this may not work for you. Also be<br>
&gt; sure to make sure it doesn ’ t break something on other browsers.<br>
&gt; &lt; script type= &quot;text/javascript&quot; &gt;<br>
&gt; function submitform () {<br>
&gt; if ( validateForm ()) {<br>
&gt; document . fileupload . submit ();<br>
&gt; ignore_unload = true ; //TODO: Changed to true to get rid of Chrome error.<br>
&gt; Need to figure out why the error occurs.<br>
&gt; }<br>
&gt; }<br>
&gt; &lt;/ script &gt;<br>
&gt;<br>
&gt;<br>
&gt; SOLUTION 2, from Jules, who is the Zendto owner and actually knows what he’s<br>
&gt; doing:<br>
&gt;<br>
&gt;<br>
&gt; From: Jules [ mailto:<a href="mailto:Jules@Zend.To">Jules@Zend.To</a> ]<br>
&gt; Sent: 02 January 2014 11:15<br>
&gt; To: John Webber (NBI)<br>
&gt; Cc: ZendTo Users<br>
&gt; Subject: Re: FW: Issue with Chrome browser - &quot;Leave this Page&quot;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; I&#39;ve got a quick fix for this. Unfortunately it means you can navigate away<br>
&gt; from (and hence abort) a running upload, but it stops the Chrome warning, so<br>
&gt; is better than nothing.<br>
&gt;<br>
&gt; You want to edit /opt/zendto/templates/new_dropoff.tpl file:<br>
&gt;<br>
&gt; Find the start of the &quot;submitform&quot; function, and add the last line of this<br>
&gt; little code snippet:<br>
&gt;<br>
&gt; &lt;script type=&quot;text/javascript&quot;&gt;<br>
&gt; function submitform() {<br>
&gt; if (validateForm()) {<br>
&gt; window.onbeforeunload=function(){}<br>
&gt;<br>
&gt; Jules.<br>
&gt; ————————————————————————<br>
&gt; Good Luck!<br>
&gt; Gray McCord<br>
&gt; Adapt, Mutate, Migrate, or Die<br>
&gt; -C. Darwin<br>
&gt;<br>
</div></div>Gray,<br>
<br>
Thanks for the help. It looks like both of these solutions achieve the same effect.<br>
The first solution makes the doBeforeUnload function return immediately (rather<br>
than doing anything):<br>
        function doBeforeUnload() {<br>
               if(ignore_unload) return; // Let the page unload<br>
<br>
               if(window.event)<br>
                      window.event.returnValue = unload_msg; // IE<br>
               else<br>
                      return unload_msg; // FF<br>
        }<br>
<br>
This function is set as the target for onbeforeunload just below where it is defined:<br>
        if(window.body)<br>
               window.body.onbeforeunload = doBeforeUnload; // IE<br>
        else<br>
               window.onbeforeunload = doBeforeUnload; // FF<br>
<br>
<br>
The solution that Jules posted changes the function that is called for onbeforeunload<br>
to be an empty function, rather than doBeforeUnload:<br>
<span class="">&lt;script type=&quot;text/javascript&quot;&gt;<br>
function submitform() {<br>
  if (validateForm()) {<br>
    window.onbeforeunload=function(){}<br>
<br>
</span>Again thanks for the help!<br>
<span class="HOEnZb"><font color="#888888"><br>
Andrew<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
ZendTo mailing list<br>
<a href="mailto:ZendTo@zend.to">ZendTo@zend.to</a><br>
<a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto" target="_blank">http://mailman.ecs.soton.ac.uk/mailman/listinfo/zendto</a></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><font face="georgia, serif"><i><a href="http://google.com/+EvertonBrunoBernardi" target="_blank">Everton Bruno Bernardi</a></i></font><br><br><br></div></div>
</div>