Replies: 2 comments 3 replies
-
Use Select::make('advertiser_ids')
->options([
'1' => 'Advertiser 1',
'2' => 'Advertiser 2',
'3' => 'Advertiser 3',
])
->multiple()
->formatStateUsing(function (?array $state, string $operation): ?array {
if ($operation === 'create' || $operation === 'view') {
return $state;
}
return filled($state) ? $state : ['1'];
}) |
Beta Was this translation helpful? Give feedback.
3 replies
-
Hello @danharrin, Can you please check it for me? Thank you. |
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
-
Package
Form builder
Package Version
v3.2.116
How can we help you?
I want the value of the advertiser to be preselected when I edit a record.
My current code is not working as expected.
Thank you very much!
Beta Was this translation helpful? Give feedback.
All reactions