D
D
Denis Pupchenko2017-04-10 11:25:47
Django
Denis Pupchenko, 2017-04-10 11:25:47

When you specify a variable in the name field of the radio button, it turns into a checkbox, how to fix it?

<li><label for="id_rad_0"><input type="radio" id="id_rad_0" name="radio_{{ qt.id }}"  /> radio button</label></li>

07f4e2b662874cca89b0dda245b201b6.png
Tell me how to fix?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vyacheslav, 2017-04-10
@abalduy

to be honest, nothing is clear, if you want to choose an option, then why the checkbox type did not
fit Example:

<p><b>Каким браузером в основном пользуетесь:</b><Br>
   <input type="radio" name="browser" value="ie"> Internet Explorer<Br>
   <input type="radio" name="browser" value="opera"> Opera<Br>
   <input type="radio" name="browser" value="firefox"> Firefox<Br>
  </p>

The main thing here is name. If it is different, the result will be something like yours

T
tema_sun, 2017-04-10
@tema_sun

It is not necessary to do so. Use the forms.RadioSelect widget in your form
https://docs.djangoproject.com/en/1.11/ref/forms/w...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question