Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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>
Comment

option selected in laravel blade

<option value="">--Select--</option>
@foreach($array as $key => $arr)
  <option value="{{++$key}}" {{ $selectedValue == $key ? 'selected' : '' }}> {{ $arr }}</option>
@endforeach
Comment

blade select selected

    @foreach ($categories as $item)
           @if (isset($produits->categorie_id) && $item->id == $produits->categorie_id || old('categorie_id') == $item->id)
                <option selected value="{{ $item->id }}">{{ $item->libelle }}</option>
           @else
                <option value="{{ $item->id }}">{{ $item->libelle }}</option>
           @endif
   @endforeach
Comment

laravel blade @selected

<select name="version">
    @foreach ($product->versions as $version)
        <option value="{{ $version }}" @selected(old('version') == $version)>
            {{ $version }}
        </option>
    @endforeach
</select>
Comment

PREVIOUS NEXT
Code Example
Php :: display error php 
Php :: Automatically Delete Woocommerce Images After Deleting a Product 
Php :: php now 
Php :: update user role wordpress 
Php :: php artisan tinker PsyExceptionRuntimeException Unable to create PsySH runtime directory 
Php :: read csv file in php 
Php :: echo all php global variables 
Php :: php unique id 
Php :: get user type wp php 
Php :: open json file php 
Php :: php ping 
Php :: wpdb get results foreach 
Php :: php ofreach 
Php :: laravel set session timeout 
Php :: Add ... if string is too long PHP 
Php :: laravel pagination keep query string 
Php :: download pdf php 
Php :: every wordpress page redirect to localhost ? 
Php :: laravel delete relationship data 
Php :: laravel validation digits 
Php :: php delete directory 
Php :: running laravel queues in shared hosting 
Php :: php read text file into array 
Php :: tableau aléatoire php 
Php :: php rand vs mt_rand 
Php :: jwt auth laravel auth without password field 
Php :: laravel 8 blade get days and hours ago 
Php :: how to alias table name in laravel model 
Php :: transfer file using file_get_content 
Php :: codeigniter update query return value 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =