Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

array value auto fill in old value laravel 8

<select id="forWhom" name="forWhom[]" multiple class="form-control chosen">
    <option value="">--- Select ---</option>
    @foreach ($desgInfo as $key => $value)
        <option value="{{ $key }}" 
           {{ (collect(old('forWhom'))->contains($key)) ? 'selected':'' }}  />
           {{ $value }}
        </option>
    @endforeach
</select>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #array #auto #fill #laravel
ADD COMMENT
Topic
Name
2+7 =