<p>As @carlcs mentioned, it's likely due to the way you're saving the ID...</p>

<pre><code>&lt;input type="hidden" name="entryId" value="{{ entry.id }}"&gt;
</code></pre>

<p>I would omit this line to ensure you save a new comment each time.</p>

<p>If you actually want to have a form that allows <em>editing</em> of existing comments, then you need to pass in the ID of the <em>comment</em>, not the ID of the parent entry.</p>

CC BY-SA 3.0
2016-08-01T04:56:18.050Z
2016-08-01T04:56:18.050Z
Simon East
<p>You'll have to resubmit all the previous comments through hidden fields aswell. You can achieve this by looping through them in the form, and put their values into hidden inputs.</p>

CC BY-SA 3.0
2015-06-21T14:42:02.390Z
2015-06-21T14:42:02.390Z
Bob Olde Hampsink
<p>I am trying to save comments using the core method "entries/saveEntry", but every time I submit the form the last comment is overwritten, is there a simple way of submitting this information to insert instead of update all the comments?</p>

<p>I the form working in that it relates a comment to an entry using the following form:</p>

<pre><code>&lt;form method="post" accept-charset="UTF-8"&gt;
    &lt;input type="hidden" name="action" value="entries/saveEntry"&gt;
    {{ getCsrfInput() }}
    &lt;input type="hidden" name="entryId" value="{{ entry.id }}"&gt;
    &lt;input type="hidden" name="fields[usercomments][new1][type]" value="comments"&gt;
    &lt;input type="text" name="fields[usercomments][new1][fields][commentuser]" value=""&gt;
    &lt;input type="text" name="fields[usercomments][new1][fields][commenttext]" value=""&gt;
    &lt;input type="submit" value="Publish"&gt;
&lt;/form&gt;
</code></pre>

<p>I just dont get why the comments are being overwritten and how to just insert a new entry.</p>

CC BY-SA 3.0
2015-03-04T10:47:12.760Z
You're saving it with the same entry ID each time. There's another question on how to do comments related to an entry: ["Creating comments via a related section"](http://craftcms.stackexchange.com/q/2936/125). I think <s>Douglas' answer does</s> both answers do a great job explaining on how to do this properly.
carlcs
<entry><entrymodel>
Comments being overwritten on save
# Comments being overwritten on save

(Asked by: username_0 on 2015-03-04)

I am trying to save comments using the core method "entries/saveEntry", but every time I submit the form the last comment is overwritten, is there a simple way of submitting this information to insert instead of update all the comments?
I the form working in that it relates a comment to an entry using the following form:

    
    {{ getCsrfInput() }}
    
    
    
    
    


I just dont get why the comments are being overwritten and how to just insert a new entry.

**Tags:** entry, entrymodel
> **Comments:**
> **username_1**: You're saving it with the same entry ID each time. There's another question on how to do comments related to an entry: ["Creating comments via a related section"](http://craftcms.stackexchange.com/q/2936/125). I think <s>Douglas' answer does</s> both answers do a great job explaining on how to do this properly.  

---

## 2 answers

### Answer by username_2 on 2016-08-01. Score: 1

As @carlcs mentioned, it's likely due to the way you're saving the ID...


I would omit this line to ensure you save a new comment each time.
If you actually want to have a form that allows editing of existing comments, then you need to pass in the ID of the comment, not the ID of the parent entry.


---

### Answer by username_3 on 2015-06-21. Score: 1

You'll have to resubmit all the previous comments through hidden fields aswell. You can achieve this by looping through them in the form, and put their values into hidden inputs.


---

