On Wed, Jun 18, 2014 at 11:06 AM, Sebastián Richmond <sebastianrichmond2...@gmail.com> wrote: > Hi, > I am interested in a reset buttion for a form. > > I have this form.py > > > from django import forms > > class ContactForm(forms.Form): > topic = forms.ChoiceField(choices=TOPIC_CHOICES) > message = forms.CharField() > sender = forms.EmailField(required=False) > > > It adds a submit button by default but I like to add reset button and I > don't know how to do it.
Just like it doesn't output the <form> tags around your form, Django will never add any buttons by default - this is always left to you to decide what, where and how you want your form to be submitted. To make a reset button, simply put a <button> inside your <form> that has a type of "reset". When you click the button, your browser will reset the form to initial values. Cheers Tom -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFHbX1Lrhr6PQyPDMh-jYQXxNuoOCsWkcLoFpCVvSL%3Do0kvGKQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.