Open kapdom opened 3 years ago
Hello,
I don't think it has anything to do with the fact that the selected
attribute is added server side. What do you mean by "reset the selected value"?
I mean this "$(citySelect).selectpicker('refresh');"
Can you confirm that if you don't have any element with the selected
attribute, the refresh works?
If I don't add selected
attribute then works, perfectly.
Hi. If I add attribute "selected" to one of the option on the server side then I'm not able to reset selected value.
<select name="shop_id" class="my-select" data-width="100%" data-size="5" data-live-search="true" title="Select"> @foreach(shops() as $row) <option value="{{$row->id}}" @if($row->id == $shop_id) selected @endif>{{$row->name}}</option> @endforeach </select>
How to reset it if one of the option had selected attribute?