arendjr/selectivity

Redisplay form after submission. Selected options can't be removed.

Open

#186 opened on Apr 5, 2017

View on GitHub
 (1 comment) (0 reactions) (0 assignees)JavaScript (1,103 stars) (116 forks)batch import
help wanted

Description

I am trying to use Selectivity.js for a multi-select on a form with several other inputs. Upon submission, when the form is redisplayed (because of validation errors in other fields), I display the previously selected options back by using "selected" in those options.

Now, if I try to remove any of the options I had selected in the previous step and resubmit the form, the removed options continue to be selected. And that is understandable, because clicking the remove icon does not remove it from the element. How can I make the removed items also removed from the element. Or is there another way to accomplish this.

Thanks!

Contributor guide