Hi,
I want to collect some input fields that are already present in my
DOM, generate a form with jQuery and submit it. Everything works fine,
unless if one of those input fields is a type="file" field.
$(".trform .sendform").click(function(e) {
e.preventDefault();
var form = $(this).closest(".trform");
var method = form.find(":input[name=method]").val();
var action = form.find(":input[name=action]").val();
var enctype = form.find(":input[name=enctype]").val();
$(document.createElement('form'))
.attr("method",method)
.attr("action",action)
.attr("enctype",enctype);
.append($(":input",form).clone())
.submit();
});
If there is a file upload field, it's value after the submit is empty.
Any suggestions what I could do?
Regards, Jan Oliver