Question

I know IE8, IE9 have no support for FormData I've tried using html5-formdata.js and html5shiv but nothing works :C

Does anybody knows an alternative to FormData?

EDIT

I found JqueryForm as an alternative but I do not know the browser support if someone knows the support please comment :D

UPDATE 07 January 2014

html5-formdata Works very good. Thank's to the creator :)

Was it helpful?

Solution

I'm assuming that you want to send some form data server-side.

If you simply need to send simple form field values to your server in browsers that do not support the File API, either use jQuery's serialize (as stated by elclanrs in the comments), or simply submit your form. If you don't want to depend on jQuery, make use of XMLHttpRequest directly and send a POST request with the payload containing the values of all of your form fields. This will be a bit more work, though.

If one of your form fields is a file input, you MUST submit the form as jQuery's serialize will not be sufficient. If you must use a form, you can have your form target a hidden iframe if you don't want the submit to result in your main window being redirected, which will allow this to behave similar to an actual ajax request as far as the user is concerned.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top