The html output generated by {{ myform.choicefieldname }}
using eg a radioselect widget is the following (as a whole): <ul> <li><label for="id_choicefieldname_0"><input type="radio" id="id_choicefieldname_0" value="1" name="choicefieldname" /> First Choice</label></li> <li><label for="id_choicefieldname_1"><input checked="checked" type="radio" id="id_choicefieldname_1" value="0" name="choicefieldname" /> Second Choice</label></li> </ul> I want, for instace, be able to do this <li id="my_id_1"><label for="id_choicefieldname_0"><input type="radio" id="id_choicefieldname_0" value="1" name="choicefieldname" />First Choice</label></li> <li id="my_id_2"><label for="id_choicefieldname_0"><input type="radio" id="id_choicefieldname_0" value="1" name="choicefieldname" />First Choice</label></li> or whatever other customization the web designer want to have on the output. This it would be easy if I could output only <input type="radio" id="id_choicefieldname_0" value="1" name="choicefieldname" /> and <input checked="checked" type="radio" id="id_choicefieldname_1" value="0" name="choicefieldname" /> separately eg iterating through the single choices of the choicefield, instead of outputting all the <ul>...</ul> block as a whole. By the way, thank you very much for your help. separately On Jan 22, 9:16 pm, Daniel Roseman <dan...@roseman.org.uk> wrote: > On Jan 21, 11:45 pm, pinco <p.tessar...@gmail.com> wrote: > > > The code > > > {% for choice_value, choice_text in > > myform.fields.choicefieldname.choices %} > > choice_value: {{ choice_value }}<br/> > > choice_text: {{ choice_text }}<br/> > > {% endfor %} > > > gives the choices text and values associated to each choice, but > > actually do not render the html form, which is what I'm looking for. > > Right, now I'm completely confused. You do have a form, and you want > to output the form field, so why don't you just do that? > > {{ myform.choicefieldname }} > > -- > DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.