What I'm trying to do, is get the form data submitted on a form, and send this data as a POST request to another URL. It works fine on Chrome, Safari and Firefox and on IE 7,8,10 and 11, but fails on IE9! It doesn't even send any post request at all. Anyone have any idea?
The code:
$( ".submitbtn" ).on( "click", function(event) {
event.preventDefault();
//$('.submitbtn').attr('disabled', 'disabled');
var formdata = $( "form" ).serialize();
//var filedata = $('#Attachment').val();
var filedata = encodeURIComponent($('#Attachment').val());
var senddata = formdata + '&file=' + filedata;
$.ajax({
type: "POST",
url: "http://externalurl.com",
data: senddata
}).done(function (data) {
$( "form" ).submit();
});
});