konsulting / form

MIT License
0 stars 0 forks source link

Multi select box: 'old' value is not fetched correctly if input name is array #1

Open rdarcy1 opened 6 years ago

rdarcy1 commented 6 years ago

The following multi select box will not have its old input retrieved because its name is given in array syntax.

Form::select('grades[]')->withAttributes(['multiple' => 'multiple']);

Workaround:

Form::select('grades[]')->withAttributes(['multiple' => 'multiple'])->withSelected(old('grades'));
Keoghan commented 4 years ago

This should be fixed in commit 49d33b5. Need to add some testing for Laravel integration, maybe testbech and testbench dusk