How to change option HTML elements' attribute of ChoiceField?

5 views
Skip to first unread message

Taka Hi

unread,
Dec 15, 2017, 10:35:38 AM12/15/17
to Django users
I want to change option HTML attributes per option.

example:

```
<select>
  <option data-xxx="data-of-a" value="value_of_a">1. a</option>
  <option data-xxx="data-of-b" value="value_of_b">2. b</option>
</select>
```

I think that it is needed to pass extra-data from ChoiceField to ChoiceWidget Select.

How can I do this?
Reply all
Reply to author
Forward
0 new messages