serializing forms which use FilteredSelectMultiple
|Reported by:||Owned by:|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
This is minor but annoying problem.
I use django.contrib.admin.widgets.FilteredSelectMultiple on publicly visible page and post forms contents with ajax - gathering data with form.serialize(). When doing so i noticed that info from the select widget was not sent to server. I followed problem to django/contrib/admin/media/js/SelectBox.js and to SelectBox objects render method. The problem why jQuery.serialize() does not serialize selects contents is simply because those options arent selected after moving from one select to another. And they arent selected because SelectBox.render() is called after each moving - and after it none of the options have selected attribute.
Like i said - it is not big problem and it has workaround - you have to select the options in 2nd select if you want form.serialize() to pick up its contents. But when selects contents are many, then this is not easy. It would be much easyer if they remained selected after beeing moved from one select to another.
Change History (11)
comment:1 Changed 5 years ago by
|Patch needs improvement:||unset|
comment:9 Changed 3 years ago by
|Owner:||changed from nobody to Rik|
|Status:||new → assigned|