Atma
Atma

Reputation: 29767

convert form field to label or text in django

I have a form field (dropdown) that I don't want users to edit, but only see its value as a label or text.

It simply looks like this:

{{ form.activity }}

How can I accomplish this?

Upvotes: 0

Views: 207

Answers (1)

Tim Baxter
Tim Baxter

Reputation: 46

Add a readonly attribute in the widget attrs.

Upvotes: 1

Related Questions