Default value on Select field with multiple enabled #2190
Unanswered
Mark-van-Seeters-LW
asked this question in
Q&A
Replies: 2 comments
-
same same |
Beta Was this translation helpful? Give feedback.
0 replies
-
You should try using ->empty() with your default value as parameters |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When creating forms using Fields I often use the value() method to set a default value that is used when creating new model instances.
I know this is undocumented behaviour.
Now I am trying to use this on a select field that allows users to select multiple options.
The view for this field implies this is possible but it does nothing.
@if (is_array($value) && in_array($key, $value, true)) selected
$value is an empty array here
Has anybody managed to get this to work?
Beta Was this translation helpful? Give feedback.
All reactions