how to use old for select in blade laravel
<select name="example">
<option {{ old('example') == $value ? "selected" : "" }} value="{{ $value }}">{{$label}}</option>
how to use old for select in blade laravel
<select name="example">
<option {{ old('example') == $value ? "selected" : "" }} value="{{ $value }}">{{$label}}</option>
laravel old value for select option
@foreach($services as $service)
@if (old('category') == $service->id)
<option value="{{ $service->id }}" selected>{{ $service->title }}</option>
@else
<option value="{{ $service->id }}">{{ $service->title }}</option>
@endif
@endforeach
option value selected in laravel blade
{{ old('title') == '1' ? 'selected' : '' }}
<div class="form-group col-md-6">
<label>Nationality {{$profiledata->nationality}}</label>
<select id="nationality" required="" name="nationality" class="form-control">
<option value="">--Select--</option>
<option {{ ($profiledata->nationality) == 'United State' ? 'selected' : '' }} value="United State">United State</option>
<option {{ ($profiledata->nationality) == 'India' ? 'selected' : '' }} value="India">India</option>
<option {{ ($profiledata->nationality) == 'Canada' ? 'selected' : '' }} value="Canada">Canada</option>
</select>
</div>
laravel select default old value
<option value="{{ $key }}" {{ (Input::old("title") == $key ? "selected":"") }}>{{ $val }}</option>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us