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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:48:45+00:00 2026-05-28T05:48:45+00:00

I am making a form with Django, and need to manually lay out the

  • 0

I am making a form with Django, and need to manually lay out the form in the HTML. I have one field that’s a ChoiceField and the widget is a RadioSelect (i.e. radio buttons rather than select drop down). There are 2 choices in this field (i.e. there will be 2 radio buttons when it’s displayed).

If i do {{ form.fieldname }}, then it puts in both radio buttons there. I want to control where each radio button goes (since I need to put other things ‘beside’ each radio button, rather than just the textual value from the choices parameter).

I can manually enter the correct html <input type="radio" name="fieldname"…, however this won’t reflect the value, if the field is set to the first choice then this HTML won’t have selected="selected" on it.

Is there anyway, in the django template, to just put in the first radio button for a field? Something like this:

{{ form.fieldname.radio_button_0 }} (some of my custom html here)
Some more stuff {{ form.fieldname.radio_button_1 }} some more html here.
  • 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-28T05:48:46+00:00Added an answer on May 28, 2026 at 5:48 am

    This page has information on how to iterate over each radio button:
    https://docs.djangoproject.com/en/dev/ref/forms/widgets/

    See “class RadioSelect”.

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

Sidebar

Related Questions

Currently I'm making a form with JSP that I need to have a couple
I am making Django form with an optional select box. I have made a
I'm making a Django form and using ChoiceField which generates a <select> box with
I am making a custom form object in Django which has an overrided __init__
I'm making a simple form that is to step through a program iteratively. How
I'm having a little bit of trouble making a sticky form that will remember
I'm making a simple search form in rails. In my search view I have
I have a registration form that when the user enters in valid registration data
I am making an form on my website but I have an problem with
I am making form validation and when user doesn't fill one of required fields

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.