Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5844727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:20:02+00:00 2026-05-22T12:20:02+00:00

I have a simple Django form: class CommentForm(forms.Form): comment = forms.CharField(max_length=2000, required=True) post_id =

  • 0

I have a simple Django form:

class CommentForm(forms.Form):
    comment = forms.CharField(max_length=2000, required=True)
    post_id = forms.CharField(max_length=2000, widget=forms.HiddenInput, required=True)
    parent_id = forms.CharField(max_length=2000, widget=forms.HiddenInput, required=True)

Now I want to print this form several times on my page – I am doing it through a template tag, so the new form is created each time. The problem is, that I get the same ID’s for all fields.

I know about the prefix, but I do not want to change field names, because there is one handler for all forms, only to set unique IDs.

So my question:

  • Is there a way to make Django set unique IDs if I want to output a form several times, without changing the names of fields?
  • If not, is there a way to make Django not to output IDs at all?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:20:03+00:00Added an answer on May 22, 2026 at 12:20 pm

    You can control how the automatic IDs are generated with the auto_id parameter when you create a new instance of that form

    Have a look here (search for auto_id):

    http://docs.djangoproject.com/en/dev/ref/forms/api/#configuring-html-label-tags

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have this simple form: class ContactForm(forms.Form): first_name = forms.CharField(required=True) last_name = forms.CharField(required=True)
I have a simple Django Form: class testForm(forms.Form): list = forms.CharField() def getItems(self): #How
I have this simple form: class PagoDesde(forms.Form): from django import forms as f desde
I have a simple form class MyForm(forms.Form): ... fieldname = forms.CharField(help_text=Some help text) I
I have a pretty simple file upload form class in django: class UploadFileForm(forms.Form): category
I have a simple model that is defined as: class Article(models.Model): slug = models.SlugField(max_length=50,
I'm writing a simple real-estate listing app in Django. Each property needs to have
I have simple models with generic relations from this example at the Django Project
I have simple regex \.*\ for me its says select everything between and ,
Ok, i have simple scenario: have two pages: login and welcome pages. im using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.