Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

blade 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
 
PREVIOUS NEXT
Tagged: #blade #select #selected
ADD COMMENT
Topic
Name
4+1 =