Friday, December 15, 2017

How to change option HTML elements' attribute of ChoiceField?

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?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/228c2dbc-7437-473e-b580-67698829d660%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment