I'm using the Yii Mvc framework and use ajax and PHP. I cannot make it work when request update after create/save comment. I need to refresh the page after create/save to make the update/save work. What am I missing? how to make the click event not returning to the last controller/action called? thank you in advance for any help.
The steps are the following
**adresses called**
1. the user request the index page (normal call) /post/index
(the page index is rendered)
2. the user click to create comment (ajax call) /post/createComment
(the comment-form is rendered inside the index page)
3. the user click to save the comment (ajax call) /post/saveComment
(the comment is saved and the comment-form is removed)
4. the user clcik to update the comment (ajax call) /post/saveComment
is called again
nothing happens
if before point 4 I refresh the page
4. the user click to update the comment (ajax call) /post/updateComment
(the comment-form with existing comment is rendered)
5. the user click to save the commnt (ajax call) /post/saveComment
(the comment is saved and the comment-form is removed) --> ok