Right now I have a form that adds and removes forms. These forms are updated inside a div. So for example, I delete one form, a PHP file runs, deletes that form, then rebuilds the other forms inside the div.
What's wrong is that the jQuery seems to only want to run the first time, and when I try using the forms inside the newly updated div, it ignores the javascript. When the div rebuilds I tried adding the jQuery code again inside the div to hopefully run again with the forms, but that doesn't work. Here is the code... ************************************************* <script type="text/javascript"> $(document).ready(function() { $('form.resourceform').ajaxForm({ target: '#currentresources', success: function() { } }); $('form.removeresource').ajaxForm({ target: '#currentresources', success: function() { } }); }); </script> <div id="currentresources"> <form class="removeresource" action="remove.php" method="post"> <input name="title" value="asdfajsf" type="hidden"> <input value="Remove" type="submit"> </form> <form class="removeresource" action="remove.php" method="post"> <input name="title" value="asdfajsf" type="hidden"> <input value="Remove" type="submit"> </form> </div> <form class="resourceform" action="add.php" method="post"> <input name="contentidadd" value="100" type="hidden"> <input value="Add Resource" type="submit"> </form> ************************************************************************ Any ideas how that code can keep running while the div updates with new forms?