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

PREVIOUS NEXT
Code Example
Php :: laravel add timestamps to existing table 
Php :: php json request get value 
Php :: centos :Install or enable PHP gd extension. 
Php :: operador in laravel 
Php :: laravel get next record 
Php :: laravel $loop interation 
Php :: guzzlehttp php basic auth 
Php :: php function to convert string to camelcase 
Php :: PHP CSV File Export Using fputcsv() 
Php :: php max value in associative array 
Php :: remove 1 day from date in php 
Php :: php store log in a text file 
Php :: tolower php 
Php :: laravel include files 
Php :: laravel get last month records 
Php :: php change date format from d/m/y to y-m-d 
Php :: PHP strrev — Reverse a string 
Php :: yii2 arraydataprovider 
Php :: blade formatting vscode 
Php :: get key of value array php 
Php :: php prime numbers 
Php :: get last month php 
Php :: wp enqueue style for style.css 
Php :: how to get the current year in php 
Php :: php to int 
Php :: php pdo select 
Php :: Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php 
Php :: get name custom post type wordpress 
Php :: base url in php 
Php :: linux set default php 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =