7

i am trying to submit form with file attached using iframe(through AJAX). I am using rails & remotipart gem. actually i've tried jquery.form.js library as well, but no luck. when i submit form i am getting "SCRIPT5: access denied" only in IE9 and when i am redirected to the page from my gmail account. It works fine when i go to my site and submit form with file attached, but doesn't work when i go to site through the link from gmail(for other emails it works). i checked how it works - it create hidden iframe set form.target= iframe.name(name of iframe) & iframe.src=javascript:false; When form is submitted it throw exception = "SCRIPT5: access denied". I've tried to set iframe.domain = domain of my site but didn't work - iframe = $(""); btw, i am submitting form to the same domain

Anyone solved this issue ?

Dzmitry
  • 749
  • 2
  • 11
  • 25

3 Answers3

1

I don't know anything about jQuery, but it is a common javascript error. IE doesn't allow forms with files attached to be submitted from a script. If you however place the form in a seperate file and load it into an iframe, frame.form.submit() will work.

Michel
  • 4,076
  • 4
  • 34
  • 52
  • 1
    it allow forms with files to be submitted. It's only gmail & IE9 issue. I mean it doesn't work when you can to the form from gmail link. If you came from yahoo mail to the form - it will work. – Dzmitry Nov 20 '12 at 22:12
0

I suggest you to use the lastest of JQuery(> jquery-1.8.0). Since the version 1.8.0, they solved somes IE9's bugs whose this error.

http://blog.jquery.com/2012/08/30/jquery-1-8-1-released/

matthieuR42
  • 194
  • 1
  • 3
0

I had the same issue. I was using the same versions as in the example. The example worked but I didn't manage to make it work in my app.

I'm using Backbone and I think it is related to creating the form dynamically, but unfortunately I didn't have time to debug the exact problem.

I moved to https://github.com/blueimp/jQuery-File-Upload, and now it works.

Jesús Carrera
  • 11,275
  • 4
  • 63
  • 55