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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:36:43+00:00 2026-05-27T15:36:43+00:00

I would like to insert a header in a Django form. I have the

  • 0

I would like to insert a header in a Django form. I have the following fields:

Name
Price

Optional - Size
Optional - Color

But instead of having the “Optional – ” in every optional item, I would like a header, so the form looks like this:

Name
Example

Optional fields:
Size
Color

(This is pseudocode but should be easy to illustrate my point)

I know i can render each individual form field in the HTML, but I would like to still use the {{ form.as_p }} (so I don’t have to change the markup for every new field I want to add). Is there any way to define a Django property for the form so I can preserve the form.as_p and still have this additional header (and more headers for more sections of fields)?

Thank you

  • 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-27T15:36:44+00:00Added an answer on May 27, 2026 at 3:36 pm

    Well, for lack of a better option, I solved this problem by rendering the form’s individual fields instead of the whole form.

    Then I only have to do:

    <div class="fieldWrapper">
        (...Field 1...)
    </div>
    
    <h1>My Own Header</h1>
    
    <div class="fieldWrapper">
        (...Field 2...)
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a little problem where I would like to insert a svn diff
I have created a test table in MySQL and would like to insert 10
I would like to hear your directions on how to insert lines of header
I would like to insert the current Subversion revision number (as reported by svnversion
I would like to insert dates in an emacs buffer like I do in
I would like to insert notes on the fixes to be done in specific
I would like to programmatically insert additional rows into a DataGrid (to act as
I would like to change the behaviour of the insert button on the standard
Using the Northwind sample: I would like to create an insert trigger on the
I need to insert data from table1 into table2. However, I would like to

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.