dwlamb 12 Newbie Poster

Good day,

I've done some searching on this topic but am not sure if I am defining terms properly in order to get results. I am new to AJAX and can execute the process of dynamically adding some content. But I want to take it one step further for adding content more than once on a page.

This is my basic scenario.

  1. My page lists a series of posts with userid, post # and post content
  2. Like adding quick replies to posts here, I have a form that a user fills out and clicks a button
  3. AJAX does its job and I have programmed my PHP in the background to return the contents of a div with the full HTML mark-up for displaying a message
  4. The method for displaying the block of data returned from the server is to replace the InnerHTML of a div id'd as 'append'

This works great for one successful post. But what if a user wants to add a second post? Under things as I have them now, my page will only display the most recent post added dynamically. The dynamic post previous to the most recent is lost. It can only be viewed in order if the user refreshes the whole page and then adds a new post.

Hope my logic can be followed and someone can offer insight.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.