Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Issue posting form with AJAX #56

Closed
russellseymour opened this Issue · 2 comments

2 participants

@russellseymour

Hello,

I am using the Jasny File Upload widget for Twitter Boostrap to give easy file controls on a form.

I previously had version 0.6.0 of this ajax plugin and everything was working ok in that my form would post the data in AJAX and non-AJAX modes.

I am using bower to maintain my plugins and updated AJAX to the latest version. I then updated the links in my HTML to point to the new 'eldarion' files. However now when I post my form, using AJAX, with the image the file details are not sent and my PHP array is empty. (If I do the same without the AJAX class set on the form all is OK).

I have not updated the version of Jasny File Upload. I think there must be a clash with JavaScript or CSS but I cannot find out where.

I realise that this is not the easiest one to fix as it is working with another plugin. However it did work and now after the update it does not.

Any help is gratefully appreciated. Please let me know if any more information is needed.

Thanks very much, Russell

@paltman
Owner

@russellseymour sorry for the trouble. when I redesigned the library for greater extensibility I dropped support of FormData:

See c8c31ec#L2L76

and then:

c8c31ec#L0R71

This is supported by Chrome/Firefox/Safari/Opera, but only IE 10+, so I removed it for greater compatibility for the general case of non-file uploads, until such time as I can figure out a way to support both and degrade gracefully.

I don't think there is a way to provide a polyfill for IE upload support:

http://stackoverflow.com/questions/10852446/fallback-for-formdata-in-ie-8-9

So I think the best I can do is use FormData if it's available, otherwise use serialize(), but then figure out the solution so things don't break for IE 8/9 users Of course, at some point (soon I hope) we can stop worrying about these older browsers.

@paltman paltman closed this
@russellseymour

@paltman Thanks for the explanation.

It is a shame as I have been building my application up using this plugin and it was really easy to implement. I will have to stay with version 0.6.0 for the moment until I can find something that works just as well and as easily.

I had not noticed the implications with IE as I have been using Chrome and Firefox for the update to the application. And as the bit I am working on at the moment is for the Admin side of things it is a controlled environment.

Regards, Russell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.