Friday, February 24, 2012

Re: Django ExtraField

You can set a hidden input widget to the form field.

Rgds,
Marcos

On Fri, Feb 24, 2012 at 11:26 AM, coded kid <duffleboi911@gmail.com> wrote:
Hi guys, How can I get rid of the field that's beside django comment
textarea? (the field, if users fill the field[honeypot]  the users
comment will be marked as spam) I hope you get my point? Below is my
code:

comments/form.html

{% if user.is_authenticated %}
  <form action="{% comment_form_target %}" method="post">
       {% csrf_token %}
       {% if sol %}<input type="hidden" name="next"
value="{{request.path}}" />{% endif %}
       {% for field in form %}
           {% if field.is_hidden %}
               {{ field }}
           {% else %}
               {% if field.name != "name" and field.name != "email"
and field.name != "url" %}
                   {% if field.errors %}{{ field.errors }}{% endif
%}
                    {{ field }}
               {% endif %}
           {% endif %}
       {% endfor %}
       <input class="submit-post" name="post" type="submit" value="Bail
Out" />
  </form>
{% else %}
   I'm sorry, but you must be <a href="javascript:alert('send to
login page')">logged in</a> to submit comments.
{% endif %}

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.




--
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.

Jamie Zawinski, in comp.emacs.xemacs

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment