View Single Post
Old 05-15-2011, 12:40 AM   PM User | #9
bullant
Banned

 
Join Date: Feb 2011
Posts: 2,699
Thanks: 13
Thanked 395 Times in 395 Posts
bullant is on a distinguished road
Quote:
Originally Posted by roher4 View Post
This almost works except when the Add Items button is clicked, the textfield itself is moved but I want the data to be moved on its own.
It works as intended in that the original inputs are moved and not copied to the form.

If you want to copy them, then all you need to do is clone the original inputs and append them to the appropriate element in the form. In this case the while loop would need to be a for loop and you'll need a couple of other minor tweaks as well.

If you want to copy just the values of the original inputs you can get them from the inputs value property.

You will also need to delete any existing contents in 'addedItems' before appending any new items otherwise you will get duplicate data if you create new items after already adding some.

Last edited by bullant; 05-15-2011 at 12:43 AM..
bullant is offline   Reply With Quote