Ok

A lot of people are looking for this so I will share the solution.

So the Solution is very easy:


$("#mychild").ajaxForm({
        success:
            function(data) {
                $("#target").append($('#OnTheFly').clone().attr({ style:
"display:" }));
                $("#Myid").val(data);  // Here I get the reponse of this
Ajax
                 $("#OnTheFly").ajaxForm({
                        success:
                            function(data) {
                            // something
            }
        });


            }
        });


Please let me know if is fine and if I can commit this improve to Jquery
Forms Documentation.

Regards

Mario Moura



2007/12/13, Mario Moura <[EMAIL PROTECTED]>:
>
> Hi
>
> I want create a AJAX Forms on the fly.
>
>
>
> $("#mychild").ajaxForm({
>         success:
>             function(data) {
>                 $("#target").append($('#OnTheFly').clone().attr({ style:
> "display:" }));
>                 $("#Myid").val(data);  // Here I get the reponse of this
> Ajax
>             }
>         });
>
>
>
> So I have a hide form (Let say my template) so I just clone it.
>
>
>   <form style="display: none;" method="post" id="OnTheFly" action="
> submit.php">
>
>     <input  type="text" id="Myid" name="myname" />
>
>   <input type="submit" value="Add" />
>
>
>
>
> this form will be transform to
>
>
>
>   <form style="display: none;" method="post" id="OnTheFly" action="
> submit.php">
>
>     <input  type="text" id="Myid" name="myname" VALUE="DATA" />
>
>   <input type="submit" value="Add more" />
>
>
>
> Unfortunately Jquery cant clone the event so When I click in the "cloned
> form" Jquery can't run the event like:
>
>
>
>  $("#OnTheFly").ajaxForm({
>         success:
>             function(data) {
>             // something
>             }
>         });
>
>
>
>
> I tried "Copy Events" plugin but didnt work with Jquery Forms or I made
> something wrong.
>
> Can Brandon Aaron help me? Seems to be the expert in this area.
>
> Someone have an Idea?
>
> Regards
>
> Mario Moura
> macm
>

Reply via email to