Change a Django form field to a hidden field

后端 未结 7 2103
故里飘歌
故里飘歌 2020-12-22 20:21

I have a Django form with a RegexField, which is very similar to a normal text input field.

In my view, under certain conditions I want to hide it from

7条回答
  •  Happy的楠姐
    2020-12-22 20:51

    You can just use css :

    #id_fieldname, label[for="id_fieldname"] {
      position: absolute;
      display: none
    }

    This will make the field and its label invisible.

提交回复
热议问题