Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel select selected

    @foreach ($categories as $item)
           @if (isset($produits->categorie_id) && $item->id == $produits->categorie_id || old('categorie_id') == $item->id)
                <option selected value="{{ $item->id }}">{{ $item->libelle }}</option>
           @else
                <option value="{{ $item->id }}">{{ $item->libelle }}</option>
           @endif
   @endforeach
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #select #selected
ADD COMMENT
Topic
Name
6+1 =