Closed hernanfila closed 5 years ago
@hernanfila:
You're doing it in a wrong way. Check this:
@hernanfila:
By default, the submitted form value of select_multiple elements is label (human readable representation of the value chosen). However, that part of the behaviour has been made configurable. You can choose between the following options:
Consider the following list of (value, label) choices (the first element in the tuple is value, the second element is label):
[
('alpha', 'Alpha'),
('beta', 'Beta'),
('gamma', 'Gamma'),
]
- "val": `value` (example: "alpha").
- "repr" (default): `label` (example: "Alpha").
- "mix": `value (label)` (example: "Alpha (alpha)").
Simply set the FOBI_FORM_ELEMENT_SELECT_MULTIPLE_SUBMIT_VALUE_AS assign one of the following values: "val", "repr" or "mix" to get the desired behaviour.
That applies to all multi-value plugins.
Hi @barseghyanartur , I am getting an issue when selecting more than one item in the select multiple element:
Select one or more:![image](https://user-images.githubusercontent.com/1685461/47862471-f69b2200-ddd3-11e8-9368-043589c0a904.png)
In the server, I want to read selected values, but it seems to be taking only one item: When I print request.POST.dict(), I see only one value in the select Multiple field.
Do you know how can I get all selected values?
Thank you