Connecting Tech Pros Worldwide Help | Site Map

Issue with using iFrame for download in IE6

 
LinkBack Thread Tools Search this Thread
  #1  
Old September 5th, 2008, 01:36 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 220
Default 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.

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. function download_req_doc(req_doc){
  3.     var answer = confirm("Would you like to download the required documents?")
  4.     if(answer){
  5.         valid_req_doc = document.getElementById(req_doc).value
  6.         oIfrm=document.getElementById('myIFrm')
  7.         oIfrm.src=valid_req_doc
  8.         alert("To complete the evaluation process please submit the completed document to Human Resources.")
  9.         alert("REMEMBER: YOU MUST SAVE THIS FILE TO YOUR COMPUTER!")
  10.     }
  11. }
  12. </script>
  13.  
  14. ...
  15.  
  16.             <cfif session.access eq 'manager' or session.access eq 'admin'>
  17.                 <li><a href="##" onclick="download_req_doc('valid_req_path');">Download Required Documents</a></li>
  18.             </cfif>
  19.  
  20. ...
  21.  
  22. <iframe id="myIFrm" src="" style="display:none"></iframe>
  23.  
Reply
  #2  
Old September 5th, 2008, 02:33 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,235
Default

I don't know if this will solve the problem, but try giving it a name and access using window.frame["frameName"].
Reply
  #3  
Old September 5th, 2008, 04:20 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 220
Default

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
Reply
  #4  
Old September 5th, 2008, 04:25 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,235
Default

Sorry, that should've been window.frames[].
Reply
  #5  
Old September 5th, 2008, 04:44 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 220
Default

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
Reply
  #6  
Old September 5th, 2008, 05:02 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,235
Default

OK, instead of hiding it, try making it 0 size:
Expand|Select|Wrap|Line Numbers
  1. <iframe ... style="width:0px; height:0px; border: 0px">
Reply
  #7  
Old September 11th, 2008, 04:10 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 220
Default

Quote:
Originally Posted by acoder
OK, instead of hiding it, try making it 0 size:
Expand|Select|Wrap|Line Numbers
  1. <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.
Reply
  #8  
Old September 12th, 2008, 11:43 AM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,235
Default

With window.frames[] syntax, use location.href. See this link.
Reply
  #9  
Old September 15th, 2008, 03:26 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 220
Default

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.
Reply
  #10  
Old September 15th, 2008, 05:33 PM
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,235
Default

...or encourage them to upgrade. Sorry I couldn't help further.
Reply
  #11  
Old September 16th, 2008, 12:13 PM
Familiar Sight
 
Join Date: Sep 2007
Posts: 220
Default

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!!
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

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 220,840 network members.