Closed chibko closed 7 years ago
I have found a solution. In the templates folder, ajaxform.html5 i have replace
$.ajax({
type: '<?php echo strtoupper($this->method); ?>',
data: form.serialize(),
cache: false,
success: function(data) {
by
$.ajax({
type: '<?php echo strtoupper($this->method); ?>',
data: formData,
async: false,
cache: false,
contentType: false,
processData: false,
success: function(data) {
Don't know if it's the best way, but works on firefox, chrome, safari and even IE9 ! This fix is for jquery layout…
File uploads do not work in Ajax by default, especially not in all browsers. I think you should use a regular form if there are file uploads...
Yes i know, but in modern browsers it seems to work well and i was surprised that it works even on IE9. I will check on various browsers. Thanks Andreas.
Just in addition to the code above the formData represents the FormData
object. I see no reason to not incorporate this fix.
var formData = new FormData(this);
Fixed in e32cb00.
Hello,
It seems that ajaxform doesn't handle input file. The form is send but the file is not stored in the selected folder. When input file is mandatory, the form i not send, i have a message saying that the file field can't be empty… Ajaxform 1.0.2 and Contao 3.5.12.