 | 
September 5th, 2008, 02:36 PM
| | Familiar Sight | | Join Date: Sep 2007
Posts: 211
| | Issue with using iFrame for download in IE6
I'm having an issue in IE6 (not an issue in IE7 or Firefox) where the file save dialog window isn't appearing. I'm using a hidden iframe to prompt for a download when a user clicks a link. Any help would be appreciated. -
<script type="text/javascript">
-
function download_req_doc(req_doc){
-
var answer = confirm("Would you like to download the required documents?")
-
if(answer){
-
valid_req_doc = document.getElementById(req_doc).value
-
oIfrm=document.getElementById('myIFrm')
-
oIfrm.src=valid_req_doc
-
alert("To complete the evaluation process please submit the completed document to Human Resources.")
-
alert("REMEMBER: YOU MUST SAVE THIS FILE TO YOUR COMPUTER!")
-
}
-
}
-
</script>
-
-
...
-
-
<cfif session.access eq 'manager' or session.access eq 'admin'>
-
<li><a href="##" onclick="download_req_doc('valid_req_path');">Download Required Documents</a></li>
-
</cfif>
-
-
...
-
-
<iframe id="myIFrm" src="" style="display:none"></iframe>
-
| 
September 5th, 2008, 03:33 PM
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 12,964
| |
I don't know if this will solve the problem, but try giving it a name and access using window.frame["frameName"].
| 
September 5th, 2008, 05:20 PM
| | Familiar Sight | | Join Date: Sep 2007
Posts: 211
| | Quote: |
Originally Posted by acoder I don't know if this will solve the problem, but try giving it a name and access using window.frame["frameName"]. | I tried to name my iframe to myIFrm and changed my javascript to this:
window.frame["myIFrm"].src=valid_req_doc
but that gave me a javascript error
| 
September 5th, 2008, 05:25 PM
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 12,964
| |
Sorry, that should've been window.frames[].
| 
September 5th, 2008, 05:44 PM
| | Familiar Sight | | Join Date: Sep 2007
Posts: 211
| | Quote: |
Originally Posted by acoder Sorry, that should've been window.frames[]. | O yeah, I should have known that. I tried it again, no error but the dialog window won't appear. Stupid IE 6, errrr
| 
September 5th, 2008, 06:02 PM
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 12,964
| |
OK, instead of hiding it, try making it 0 size: - <iframe ... style="width:0px; height:0px; border: 0px">
| 
September 11th, 2008, 05:10 PM
| | Familiar Sight | | Join Date: Sep 2007
Posts: 211
| | Quote: |
Originally Posted by acoder OK, instead of hiding it, try making it 0 size: - <iframe ... style="width:0px; height:0px; border: 0px">
| Hey acoder, sorry it took me a while to respond, I was on vacation. I tried setting the height/width but it didn't work either, hmmmm.
| 
September 12th, 2008, 12:43 PM
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 12,964
| |
With window.frames[] syntax, use location.href. See this link.
| 
September 15th, 2008, 04:26 PM
| | Familiar Sight | | Join Date: Sep 2007
Posts: 211
| | Quote: |
Originally Posted by acoder With window.frames[] syntax, use location.href. See this link. | Tried a few of those methods from that page, but still nothing. I'll just tell them to download off the network for those users using IE 6.
| 
September 15th, 2008, 06:33 PM
|  | Site Moderator | | Join Date: Nov 2006 Location: UK
Posts: 12,964
| |
...or encourage them to upgrade. Sorry I couldn't help further.
| 
September 16th, 2008, 01:13 PM
| | Familiar Sight | | Join Date: Sep 2007
Posts: 211
| | Quote: |
Originally Posted by acoder ...or encourage them to upgrade. Sorry I couldn't help further. | You are a huge help acoder, I appreciate your help very much!!
|  | | Thread Tools | Search this Thread | | | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 205,248 network members.
|