これを試してください。代わりに、ボタンを使用して、画像を使用する:
<form action="/vcontent?topic={{ topic.name }}" method="post">
{% if user and user.email in c.users_up %}
<input type="image" src="icons/thumb-up.png" alt="Up!" name = "vote" value = "up" />
{% else %}
<input type="image" src="icons/thumb-up_gray.png" alt="Up!" name = "vote" value = "up" />
{% endif %}
<input type="hidden" name = "vote" value = "up"/>
<input name= "content_key" type="hidden" value="{{ c.key.urlsafe() }}">
</form>
<form action="/vcontent?topic={{ topic.name }}" method="post">
{% if user and user.email in c.users_down %}
<input type="image" src="icons/thumb-down.png" alt="Down!" name = "vote" value = "down" />
{% else %}
<input type="image" src="icons/thumb-down_gray.png" alt="Down!" name = "vote" value = "down" />
{% endif %}
<input type="hidden" name = "vote" value = "down"/>
<input name= "content_key" type="hidden" value="{{ c.key.urlsafe() }}">
</form>
:
<style>button {height:32px; width:32px;}</style>
<form action="/vcontent?topic={{ topic.name }}" method="post">
{% if user and user.email in c.users_up %}
<button type="submit" style="background: url(icons/thumb-up.png)" title="Up!" name="vote" value="up" />
{% else %}
<button type="submit" style="background: url(icons/thumb-up_gray.png)" title="Up!" name="vote" value="up" />
{% endif %}
{% if user and user.email in c.users_down %}
<button type="submit" style="background: url(icons/thumb-down.png)" title="Down!" name="vote" value="down" />
{% else %}
<button type="submit" style="background: url(icons/thumb-down_gray.png)" title="Down!" name="vote" value="down" />
{% endif %}
<input name= "content_key" type="hidden" value="{{ c.key.urlsafe() }}">
</form>
あなたは ' mplungjan
はい、それはそのように動作します。これは、押されたときにフォームを送信するアイコンです。しかし、vote = "up"かvote = "down"のどちらかでなければなりません。 –