Why don't you simply submit the form you are cloning from? It doesn't
appear to me that you're adding anything to the new form.

On Sat, Dec 19, 2009 at 10:57 AM, oli <janoli...@gmail.com> wrote:
> 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
>

Reply via email to