Django Hidden Fields

Quick shortcut for including hidden fields in your forms:

class SomeForm(forms.Form):
hidden = forms.CharField(required=False, max_length=50, widget=forms.HiddenInput())

view raw

hosted with ❤ by GitHub


{% for hidden in form.hidden_fields %}
{{ hidden }}
{% endfor %}

view raw


hosted with ❤ by GitHub

Now you don’t have to worry about each and every hidden field.

One thought on “Django Hidden Fields”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s