“Disabled” option for choiceField - Django

前端 未结 7 1105
别跟我提以往
别跟我提以往 2020-12-24 14:02

I having trouble with a simple question : How to have some \"disabled\" field in a dropdown menu generated via a modelForm and choiceFied in the django Framework ?

7条回答
  •  时光取名叫无心
    2020-12-24 14:35

    Are you trying to create a menu in which the list items are separated into categories, and you don't want the categories themselves to be selectable?

    If so, you can achieve this by having your template render the field using tags, e.g.

    
    

提交回复
热议问题