3 Replies Latest reply on Jun 30, 2017 9:43 AM by WolfShade

    CFHEADER/CFCONTENT to offer a file to a user isn't triggering iFrame onload or onchange

    WolfShade Level 4

      Hello, all,

       

      I'm submitting a form to itself (form target is set for an iframe on the same page) to generate an Excel file and offer it to the user for either download or open.  So far, everything is working great except one minor thing.

       

      When the form submits, I add an animated circle 'progress' image to imply working in the background.  Once CFHEADER and CFCONTENT offer the file, I'm trying to get the gif to detach or hide.

       

      I've tried using the iframe onLoad and onChange, but apparently that isn't being triggered.  Is there another way to trigger some kind of event when the file is offered?

       

      <form target="exportToExcel" method="post" enctype="application/x-www-form-urlencoded">

      ...<select id="FQDN" name="FQDN">...</select>

      </form>

      <iframe id="exportToExcel" width="1" height="1" src="about:blank"></iframe>

       

      Javascript:

       

      FQDN = document.getElementById('FQDN');

      ... // set FQDN onchange to submit the form

       

      ifrm = document.getElementById('exportToExcel');

      ifrm.onload = function(){return function(){mc.innerHTML = ''}}; //I've also tried removeChild(), no worky.

       

      V/r,

       

      ^ _  ^