58 questions
0 votes
1 answer
38 views
Certain django-select2 fields won't render when multiple forms are used on single template
I have an issue rendering some select2 fields: When multiple forms with same select2 widget are used within a single template some select2 fields are not rendered as expected (rendered just as normal ...
1 vote
0 answers
57 views
Select2 Drop downs not loading in multi-modals django page
I have an issue with a Django front I'm trying to implement. I'm using select2 to show dropdown menus in which I can search in. The problem is that I have two different modals, each has it's dropdown ...
0 votes
0 answers
37 views
Create non existing tag with Django-select2
I am using django-select2 to autocomplete a tag field on a model. I would like to let user write any tag in the field, and create it if the tag doesn't exists... # models.py class Version(models.Model)...
3 votes
1 answer
856 views
Django-Select2 Bootstrap5 Theme
I'm having a problem getting the Django-Select2 Bootstrap5 theme working. The select2 element is displaying the correct field from the DB, and my search function works correctly, it's just the theme ...
2 votes
1 answer
344 views
Issue with how the django_easy_select2 library is initialized or bound to the HTML element that I'm replacing with htmx
I've successfully used htmx to handle a AJAX call to replace part of an django template form. Please see the question I posted on this here Django and HTMX for dynamically updating dropdown list in ...
0 votes
0 answers
78 views
Django Select2 Widget bad rendering?
I tried to implement multi select-boxes from select2. The widget works fine, but the user input is under the field. Screen: this how it looks in html. <select class="js-example-basic-multiple&...
1 vote
1 answer
1k views
Django Forms: Django-select2 Not rendering multi select box correctly
I'm using django-select2 : https://django-select2.readthedocs.io/en/latest/index.html I'm attempting to create a multiple tag select dropdown box similar to this: https://raw.githubusercontent.com/...
0 votes
1 answer
593 views
django-select2 programatically setting value
I'm using Django-select2 to show select2 widgets on my forms. On one of these form select-fields I want to user to be able to set the value by clicking a link containing a suggestion. My javascript ...
0 votes
1 answer
477 views
Django-filters - How to add autocomplete feature
I have made filters using django-filters. As a result I get a dropdown menu. Is it possible to add an autocomplete/search field to this dropdown? I have already tried to add the Select2Widget widget ...
0 votes
1 answer
871 views
Filter queryset in django select2 widget
Is it possible to filter queryset in Django Select2 forms? I got a form that sends a direct message to the user and I want to have the possibility to filter users. s2forms.ModelSelect2Widget, as I see,...
0 votes
1 answer
658 views
How to send the text in django-select2 field instead of the id at form submission?
This is a two-part question Problem description I have a form with a field that uses ModelSelect2TagWidget (that accepts free-text as an input). when the user enters a number as free-text, it is ...
0 votes
2 answers
3k views
How do I use a select2 multiple select in a django crispy form?
I have an existing crispy form. I want to use django-select2 to replace an existing multi-select with a Select2 field with a maximum of two selections. I know from this post that I need to include '...
1 vote
0 answers
376 views
Django Select2 ModelSelect2TagWidget Problem
I followed the documentation on how to use the ModelSelect2TagWidget from the django-select2 library, but when I submit the form I get "Select a valid choice error" on the tag field ...
0 votes
1 answer
1k views
How to add a searchable text field to select an item in drop down list?
I have a filter form as you can see https://jsfiddle.net/aba2s/qcsynt7f/6/. I would like to add a searchable field(in the red area) so users can filter the campaign naming tool object instead of ...
0 votes
1 answer
576 views
Select2 widget showing on Django Admin site but not on the form template in Django4
I have two object models, NewsObject and StockObject. The stock object is a foreign key in the news object. class stockObject(models.Model): stock_name = CharField(max_length=100, blank=True, null=...