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 836849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:02:55+00:00 2026-05-15T05:02:55+00:00

I have an edit object view that contains a formset(one or many if this

  • 0

I have an edit object view that contains a formset(one or many if this matters), now I want to create a page that can display multiple edit object forms and submit it in a single form.

What is the correct way to achieve this task?

  • 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-15T05:02:56+00:00Added an answer on May 15, 2026 at 5:02 am

    I found a solution.

    I can enumerate my objects on edit page and use different prefixes for formsets based on these indexes. Here is an example:

    First, you need enumeration, I achieved it using same input(checkbox) name with incremental values:

    <input type="checkbox" name="counter" value="0">
    ...
    <input type="checkbox" name="counter" value="1">
    ...
    

    Counter numbers is the formset and other data serial numbers:

    <!--Ordinary inputs-->
    <input type="text" name="data0" value="value0">
    <input type="text" name="data1" value="value1">
    <!--Formsets-->
    <input type="text" id="test0-0-data" name="test0-0-data" value="something">
    <input type="text" id="test0-1-data" name="test0-1-data" value="something">
    <input type="hidden" name="test0-TOTAL_FORMS" id="id_test0-TOTAL_FORMS" value="2">
    <input type="hidden" name="test0-INITIAL_FORMS" id="id_test0-INITIAL_FORMS" value="0">
    
    <input type="text" id="test1-0-data" name="test1-0-data" value="something">
    <input type="hidden" name="test1-TOTAL_FORMS" id="id_test1-TOTAL_FORMS" value="1">
    <input type="hidden" name="test1-INITIAL_FORMS" id="id_test1-INITIAL_FORMS" value="0">
    

    Then if code you populate formsets like this:

    counter = request.POST.getlist('counter')
    for i in counter:
        TestFormset = modelformset_factory(Test, form=TestForm)
        test_formset = TestFormset(request.POST, prefix='test'+i, queryset=Test.objects.none())
    

    I achieved HTML structure above with JavaScript.

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

Sidebar

Related Questions

I have 3 (Edit) mutually exclusive IEnumerables that I want to iterate over. I
I have a form JSP web page, this form contains multiple instances of the
I have an object that contains all login data, that's in my controller (it
I have a view with a grid that contains items added to a workstation.
I have a MainWindow that contains a window with a TreeView. The tree view
One of my backbone view's initialize function contains the following code: $.when(this.broadcasters.fetch(), this.model.fetch(), this.call_types.fetch()).done(
I have a DataGrid of objects, and I want to modally edit them; pop
I won't want to have edit any working sets. I just want a way
I have 2 edit texts. I will type a message in one of the
I have a edit View - Product/Edit/1 1 being the Id of the Product.How

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.