0👍
maybe you can do:
Choices1 = [("0", _("0")), ("1", _("1")),("2", _("2"))[("3", _("3"))]
options = (value for key, value in Choices1 )
list = forms.CharField(widget=forms.Textarea(attrs{'selectBoxOptions':';'.join(options)})),label=_("ListExample"),required=False)
in your html, you could try:
<form>
{{form.as_p}}
</form>
<script type="text/javascript">
createEditableSelect(document.forms[0].myText);
</script>
0👍
For future reference: the solution is now available with html5 which allows editable dropdown list.
And so with Django: https://stackoverflow.com/a/32791625/1937033
- [Django]-OneToMany Relationship for more generic django apps
- [Django]-Serializers in django rest framework with dynamic fields
- [Django]-Inheritance model update to its parent model
- [Django]-How to install mod_wsgi on Windows+XAMPP in 2017
Source:stackexchange.com