I've been working on a script to slide in new table rows with form elements inside them and then either submit all the rows or cancel and remove them - either one at a time or all at once. I've got the basics down, but I've just got a few minor problems and I've marked them in my code with //PROBLEM: in the comments.
1.) When I add a new row or remove all added rows, the callback after the animation is called once for each div in the table row, since that's what I'm performing the animation on. I need a way to limit this to only happen once. 2.) If the "add" button is clicked very fast (only initially), the submit/cancel controls never appear. Not sure why, but I need a way around this. 3.) If rows are removed individually, when I get down to 1 row the controls do not move to the correct spot. I know why this happens, but I'm not sure how to fix it. Here it is: http://jsbin.com/ixezo - (and just to mention I need to use function calls instead of $(element).click()'s so please don't re- format anything like that). Any help or insight here is greatly appreciated! Also, I had some earlier questions solved in this thread: http://groups.google.com/group/jquery-en/browse_thread/thread/71700099cac1da40/07bc5f560e541fb1 (just for reference)