-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to prepopulate the selected choices in HeavySelect2MultipleWidget and ModelMultipleChoiceField #4
Comments
Hello. I also ran into a problem. When you need to edit form data, the transmitted data is not displayed. You have to re-select this data. |
I'm having the same issue. Have you been able to solve this in the meanwhile? |
I am afraid this is a known issue. I would love to see someone come up with a solution tho. |
Do you happen to use django-crispyforms? In our case the issue was caused by the combinated use of select2 and crispy forms. |
I have the same issue. Deleting django-crispyforms didn't help. |
Has been any improvement in this issue? |
Select2 want the preselected values as option-elements with selected="selected": https://select2.org/data-sources/ajax#default-pre-selected-values I did this the following way:
If anyone have any better suggestions after seeing my workaround, please share. |
Goal
How to pre populate multiple selected choices in HeavySelect2MultipleWidget and in ModelMultipleChoiceField
Problem
When form reloaded with validation error, all the pre selected choices will vanish for HeavySelect2MultipleWidget, ModelMultipleChoiceField
also not finding a way to pre populate the selected choices when you load update form...
Code Snippet
The text was updated successfully, but these errors were encountered: