Skip to main content
WolfShade
Legend
June 28, 2017
Question

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

  • June 28, 2017
  • 1 reply
  • 1624 views

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,

^ _  ^

    This topic has been closed for replies.

    1 reply

    Inspiring
    June 29, 2017

    Im assuming the iFrame is on the same domain?

    Does developer console say anything when trying this?

    WolfShade
    WolfShadeAuthor
    Legend
    June 29, 2017

    Hi, haxtbh​,

    I tried several times yesterday to log on and let everyone know that I found a workaround.  Stupid servers couldn't log me on.

    Sadly, I will have to come back later to let everyone know how I did it.  We were just informed yesterday that we have until COB tomorrow to vacate the room that we are in so another department can have it.  So we are packing and moving.

    V/r,

    ^ _ ^