<p>Not an answer, but one thing that might help you diagnose the problem, is to output all the return errors (without having to define it on each field as the example templates do).</p>

<pre><code>{% macro errorList(errors) %}
    {% if errors %}
        &lt;ul class="errors"&gt;
            {% for error in errors %}
                &lt;li&gt;{{ error }}&lt;/li&gt;
            {% endfor %}
        &lt;/ul&gt;
    {% endif %}
{% endmacro %}

{% from _self import errorList %}

{% if account is defined %}
    {{ errorList(account.getAllErrors()) }}
{% endif %}

{% if entry is defined %}
    {{ errorList(entry.getAllErrors()) }}
{% endif %}
</code></pre>

<p>A User Model named 'account' is returned by default from a failed <code>users/saveUser</code> post action, and an Entry Model named 'entry' is returned by default from a failed <code>entries/saveEntry</code> post action.</p>

<p>I have also found the <a href="http://straightupcraft.com/craft-plugins/inspector" rel="nofollow">Inpector</a> plug-in extremely helpful. You can then add <code>{{ account | inspect }}</code> or <code>{{ entry | inspect }}</code> within the <code>if</code> statements above to get more info.</p>

CC BY-SA 3.0
2014-09-26T20:54:07.950Z
2014-09-26T20:59:49.720Z
2014-09-26T20:59:49.720Z
Douglas McDonald
<p>Our client wants a poll on the website.
How can I deal with client input and update the entry?
I found the <a href="http://buildwithcraft.com/docs/templating/entry-form" rel="nofollow">Entry-Form example</a>, but this doesn't work. </p>

<p>The title field is the question and the admin can add answers with a matrix field. Within the matrix fields there are 2 fields: answer and totalVotes </p>

<p>This is my code:</p>

<pre class="lang-twig prettyprint-override"><code>&lt;form class="poll__questions" method="post" action="" accept-charset="UTF-8"&gt;
    &lt;input type="hidden" name="action" value="entries/saveEntry"&gt;
    &lt;input type="hidden" name="redirect" value="{{ craft.request.getPath }}?success=√"&gt;
    &lt;input type="hidden" name="sectionId" value="38"&gt;
    &lt;input type="hidden" name="entryId" value="{{ pollentry.id }}"&gt;
    &lt;input type="hidden" name="enabled" value="1"&gt;

    &lt;ul&gt;
    {{% for answer in pollentry.answers %}
        &lt;li&gt;&lt;label&gt;&lt;input type="radio" name="fields[answers][{{ answer.id }}][fields][totalVotes]" value="{{ answer.totalVotes + 1 }}"&gt; {{ answer.answer }}&lt;/label&gt;&lt;/li&gt;
    {% endfor %}}
    &lt;/ul&gt;
    &lt;button type="submit" class="button button--third"&gt;Vote&lt;/button&gt;
&lt;/form&gt;
</code></pre>

<p>Does anybody know why this doesn't work. It submits the form without visible errors, but it doens't update the entry.</p>

CC BY-SA 3.0
2014-07-01T09:48:37.410Z
The EntryModel is likely failing validation somewhere.  If it is, and you check your craft/storage/runtime/logs folder, you can see where that is happening.
Brad Bell
CC BY-SA 3.0
2014-07-12T05:45:07.940Z
Did the logs help you identify your problem?
Tyler Willingham
CC BY-SA 3.0
2014-07-13T09:19:37.033Z
No this didn't help me with my problem. I solved it with a plugin and not with matrix fields, but with normal fields.
sneeky
CC BY-SA 3.0
2014-07-13T21:33:50.003Z
@sneeky Would you mind sharing your solution as an answer? Asking and answering your own questions is totally legit!
Matt Stein
<entries><updating>
How to deal with client input your site?
# How to deal with client input your site?

(Asked by: username_0 on 2014-07-01)

Our client wants a poll on the website.
How can I deal with client input and update the entry?
I found the Entry-Form example, but this doesn't work. 
The title field is the question and the admin can add answers with a matrix field. Within the matrix fields there are 2 fields: answer and totalVotes 
This is my code:

    
    
    
    
    

    
    {{% for answer in pollentry.answers %}
         {{ answer.answer }}
    {% endfor %}}
    
    Vote


Does anybody know why this doesn't work. It submits the form without visible errors, but it doens't update the entry.

**Tags:** entries, updating
> **Comments:**
> **username_1**: The EntryModel is likely failing validation somewhere.  If it is, and you check your craft/storage/runtime/logs folder, you can see where that is happening.  
> **username_2**: Did the logs help you identify your problem?  
> **username_0**: No this didn't help me with my problem. I solved it with a plugin and not with matrix fields, but with normal fields.  
> **username_3**: @sneeky Would you mind sharing your solution as an answer? Asking and answering your own questions is totally legit!  

---

## 1 answers

### Answer by username_4 on 2014-09-26. Score: 2

Not an answer, but one thing that might help you diagnose the problem, is to output all the return errors (without having to define it on each field as the example templates do).
{% macro errorList(errors) %}
    {% if errors %}
        
            {% for error in errors %}
                {{ error }}
            {% endfor %}
        
    {% endif %}
{% endmacro %}

{% from _self import errorList %}

{% if account is defined %}
    {{ errorList(account.getAllErrors()) }}
{% endif %}

{% if entry is defined %}
    {{ errorList(entry.getAllErrors()) }}
{% endif %}

A User Model named 'account' is returned by default from a failed users/saveUser post action, and an Entry Model named 'entry' is returned by default from a failed entries/saveEntry post action.
I have also found the Inpector plug-in extremely helpful. You can then add {{ account | inspect }} or {{ entry | inspect }} within the if statements above to get more info.


---

