“Laravel Nilai Lama untuk Opsi Pilih” Kode Jawaban

Nilai Opsi Dipilih dalam Blade Laravel

{{ 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>
Tyagi420

Laravel Nilai Lama untuk Opsi Pilih

@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
Beautiful Bug

Laravel pilih nilai lama default

<option value="{{ $key }}" {{ (Input::old("title") == $key ? "selected":"") }}>{{ $val }}</option>
Concerned Centipede

Laravel Nilai Lama untuk Opsi Pilih

# Populate Old value with default value selected
# Laravel 8
<select name="dial_code" id="dial_code">
@foreach($countries as $c)
    <option value="{{$c->phone_code}}" title="{{$c->name}}" {{old('dial_code', 966) == $c->phone_code ? 'selected' : ''}}>{{$c->iso2}} ({{$c->phone_code}})</option>
@endforeach
</select>
PHP Web Spiders

Jawaban yang mirip dengan “Laravel Nilai Lama untuk Opsi Pilih”

Pertanyaan yang mirip dengan “Laravel Nilai Lama untuk Opsi Pilih”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya