AJAX Function to populate a field in a form in a loop using ajax

I have created a string in php ajax which contains list of forms and I displayed the same string using innerhtml in a php page( i have hidden the forms until I click a link for each form in the same string )also I have used id for the form and form fields in the loop. My problem is when the forms and links loads for the first time the forms displays properly when I click the link, but when I submit the form and list the links again with updated data and I click the links the forms are not displaying.Kindly provide me the solution for my problem

thanks in advanceā€¦