Fix stupid IE11...

This commit is contained in:
2020-05-29 14:40:54 +02:00
parent 07ac60e228
commit ba2c1e3b0f
3 changed files with 29 additions and 1 deletions

View File

@ -1073,7 +1073,16 @@
formdata.delete('csrfmiddlewaretoken');
formdata.delete('json');
jQuery('input#id_json').val(JSON.stringify(Object.fromEntries(formdata)));
// Display the key/value pairs. This is needed to support stupid IE. Mici$oft is still having hardtime playing nice :(
let json_data = {};
var formDataEntries = formdata.entries(), formDataEntry = formDataEntries.next(), pair;
while (!formDataEntry.done) {
pair = formDataEntry.value;
json_data[pair[0]] = pair[1];
formDataEntry = formDataEntries.next();
}
jQuery('input#id_json').val(JSON.stringify(json_data));
return true;
} else {
alert('Er zijn wat problemen met het formulier. Controleer de invoer velden');