[jQuery] Jquery Forms - On the Fly
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