How to use old() in multiple select without using Form::select()

Published 1 month ago by oroalej

The title already said it all, I was able to retrieve the old form value using the Form::select(). I'm just curious if this is possible in plain html?

Also, How can you validate the multiple select? since we add "[]" to the name of the select when it's multiple, the validation doesn't work in this name. Can you guys guide me on how.

1 month ago (143,050 XP)


<select name="categories[]">
    <option value="test"{!! in_array('test', old('categories')) ? ' selected' : '' !!}>Test</option>

validation: you can use Custom Validation Rules

Please sign in or create an account to participate in this conversation.