Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

populate old value of dropdown laravel

# Populate Old value with default value selected
<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>
 
PREVIOUS NEXT
Tagged: #populate #dropdown #laravel
ADD COMMENT
Topic
Name
6+3 =