Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

array value auto fill in old value laravel 8

<label for="name">Tags</label>
    <select name="tags[]" class="form-control select-tag" multiple>
      @foreach($tags as $tag)
        <option value="{{$tag->id}}" {{in_array($tag->id, old("tags") ?: []) ? "selected": ""}}>{{$tag->name}}</option>
      @endforeach
    </select>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #array #auto #fill #laravel
ADD COMMENT
Topic
Name
3+4 =