I don't have a drop-in solution, just an idea to start with:

Put your nested form after the parent form, and hide it. Keep the
upload-elements in the parent form and move them to the upload-form on
submit (using a different submit button). Clone/move back to the
parent form after the submit for more files.

Not exactly trivial, but works.

Jörn

On Sun, May 25, 2008 at 2:20 PM, Giovanni Battista Lenoci
<[EMAIL PROTECTED]> wrote:
>
> Hi, in a control panel I have a form that collect a lot of data.
> Inside this form I want to collect N images using the ajaxform plugin
> to permit an ajaxLike file upload.
>
> The problem is that if I use this markup :
>
> <form name="collectData" id="collectData" ...>
> <input type="text" value="" name="name">
>
>  <form name="ajaximgupload" id="ajaximgupload">
>    <input type="file" name="img" />
>    <input type="submit" />
>  </form>
>
>
> <input type="submit">
> </form>
>
> and this javascript:
>
> var options = { success:    function(){ alert('ok');} };
> $('#ajaximgupload').ajaxForm(options);
>
> If I press on the "ajaximgupload" submit button I submit the entire
> "collectData" form, ignoring the ajaxForm call.
>
> I now that is not correct to put a form inside another form, but for
> layout problem I can't close the form tag (the img upload is in the
> 2nd tab of a 5 tab form).
> I've tried playing around ajaxSubmit, but didn't find a solution.
>
> Do you have something to suggest me?
>
> Thank you
>
>

Reply via email to