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

  • SEARCH
  • Home
  • 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 8727759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:29:53+00:00 2026-06-13T08:29:53+00:00

I’m having difficulty using two django crispy forms simultaneously. I have one form to

  • 0

I’m having difficulty using two django crispy forms simultaneously. I have one form to just enter new data into my app and another form that displays in a bootstrap modal for users to provide feedback. Below, I’ve stripped my template down to the bare bare basics.

I have a Group form:

class Crispy_Group_Form(forms.ModelForm):

    def __init__(self, *args, **kwargs):
        self.helper = FormHelper()
        # self.helper.form_tag = False
        self.helper.form_class = 'form-horizontal'
        self.helper.layout = Layout(
            Fieldset(
                'New Group',
                Field('name', placeholder='Group Name'),
                Field('notes', placeholder='Group Notes', rows='10', css_class='input-xxlarge'),
            ),
            FormActions(
                Submit('save_changes', 'Save changes', css_class="btn-primary"),
                HTML(' | '),
                Submit('cancel', 'Cancel'),
            )
        )
        self.helper.form_id = 'id-Crispy_Group_Form'
        self.helper.form_method = 'post'


        super(Crispy_Group_Form, self).__init__(*args, **kwargs)        

    class Meta:
        model = Group
        exclude = ['slug']

and a Contact form

class Crispy_ContactForm(forms.ModelForm):

    def __init__(self, *args, **kwargs):
        self.helper = FormHelper()
        self.helper.form_class = 'form ajax'
        self.helper.form_action = 'feedback'
        self.helper.form_tag = False
        self.helper.layout = Layout(
            Fieldset(
                'Contact Form',
                Field('topic', placeholder='Topic', css_class='input-medium'),
                Field('subject', placeholder='Subject', css_class='input-xlarge'),
                Field('message', placeholder='Message', rows='5', css_class='input-xlarge'),
                Field('sender', placeholder='Sender', css_class='input-xlarge'),
            ),
        )
        self.helper.form_id = 'id-Crispy_ContactForm'
        self.helper.form_method = 'post'

        super(Crispy_ContactForm, self).__init__(*args, **kwargs)

    class Meta:
        model = Feedback
        exclude = ['creation_date']

My view:

def bootstrap_test(request):

    return render_to_response(
        "bootstrap_test.html", {
            'feedback_form' : Crispy_ContactForm,
            'form' : Crispy_Group_Form,
        },
        context_instance=RequestContext(request))

And my very basic template:

{% load crispy_forms_tags %}

<form action="{% url feedback %}" method="post" id="id-Crispy_ContactForm" class="form">
    {% crispy feedback_form %}
</form>

{% crispy form %}

The feedback_form is displaying twice. As if both forms are the same form. If I delete the feedback_form from the template, then it shows the Group form. If I rearrange the two so {% crispy form %} is above the feedback_from, it displays the two different forms correctly.

I read the documentation, but wasn’t able to find a method that works.

Why is this happening and what do I need to adjust to get this to display correctly?

  • 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-06-13T08:29:55+00:00Added an answer on June 13, 2026 at 8:29 am

    Ok, I got it. It seems crispy forms overwrites the “form” variable. That’s why this returns the same two forms:

    <form action="{% url feedback %}" method="post" id="id-Crispy_ContactForm" class="form">
        {% crispy feedback_form %}
    </form>
    
    {% crispy form %}
    

    but this returns two different forms:

    {% crispy form %}
    
    <form action="{% url feedback %}" method="post" id="id-Crispy_ContactForm" class="form">
        {% crispy feedback_form %}
    </form>
    

    The first example overwrites the variable “form” before the second form call can grab it.

    I just wanted to confirm that it wasn’t something I was doing wrong. So I simply reversed the order the two forms get called so that the instance of {% crispy form %} appears first. I couldn’t use a different variable for form because I’m using the create/update_object functions.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.