Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel select multiple value in form edit

<select name="cities[]" class="city form-control" data-placeholder="Pilih Kota" style="width: 100%;" multiple="multiple">
                    @foreach($cities as $city)
                        @if(in_array($city->id, $zoneCityIds))
                        <option value="{{ $city->id }}" selected="true">{{ $city->name }}</option>
                        @else
                        <option value="{{ $city->id }}">{{ $city->name }}</option>
                        @endif 
                    @endforeach
                    </select>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #select #multiple #form #edit
ADD COMMENT
Topic
Name
8+1 =