Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

set default selected option in select form laravel

<select class="form-control" name="category" id="category">

      @foreach($categories as $category)
           <option value="{{ $category->id }}" {{$product->catetory_id == $category->id ? 'selected' : '' }}>{{ $category->name }}</option>
      @endforeach
 </select>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #default #selected #option #select #form #laravel
ADD COMMENT
Topic
Name
7+6 =