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:
<form class="poll__questions" method="post" action="" accept-charset="UTF-8">
<input type="hidden" name="action" value="entries/saveEntry">
<input type="hidden" name="redirect" value="{{ craft.request.getPath }}?success=√">
<input type="hidden" name="sectionId" value="38">
<input type="hidden" name="entryId" value="{{ pollentry.id }}">
<input type="hidden" name="enabled" value="1">
<ul>
{{% for answer in pollentry.answers %}
<li><label><input type="radio" name="fields[answers][{{ answer.id }}][fields][totalVotes]" value="{{ answer.totalVotes + 1 }}"> {{ answer.answer }}</label></li>
{% endfor %}}
</ul>
<button type="submit" class="button button--third">Vote</button>
</form>
Does anybody know why this doesn't work. It submits the form without visible errors, but it doens't update the entry.