Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing bullets from radio buttons when using Django forms

Tags:

html

css

django

I'm trying to remove the bullets that are showing up beside the radio button when rendering a form.

My template is as follows:

<form class="form-horizontal" enctype="multipart/form-data" method="POST" action="" class="uniForm">
<fieldset class="inlineLabels">
{% csrf_token %}
<br>
<h6>Library Type</h6>
{{ formtoaddmodel.type }}
</fieldset>
</form>

The type field is a TypedChoiceField, which produced radio buttons for the choices, but the problem is it puts a bullet point before each radio button.

To remove the bullets, I read that you need to include . However, I'm not sure where to put this. When I do this in the CSS it affects everywhere in my site where I use bulleted lists. Is there a way to do this in the template to over-ride the CSS, and if yes, how?

like image 939
user1328021 Avatar asked Dec 20 '22 15:12

user1328021


2 Answers

have you tried using CSS like this?

fieldset.inlineLabels ul {list-style:none}
like image 75
JKirchartz Avatar answered Mar 07 '23 19:03

JKirchartz


I had the same problem with bullets showing up next to radio buttons for flask forms. Using the solution for bullets in flask from here, I was able to get rid of the bullets like this:

<p>
   Certification:
   {{form.certification(style="list-style:none")}}
</p>
like image 31
cardamom Avatar answered Mar 07 '23 17:03

cardamom