dimanche 6 novembre 2016

Storing and Getting the value from dropdown menu.

Having a hard time populating this country dropdown (New to Laravel)

<div class="form-group form-group-default">
<label class="">Country</label>
<select class="full-width select2-offscreen" data-placeholder="Select Country" data-init-plugin="select2" tabindex="-1" title="">
<?php if(isset($country)&&!empty($country)) {?>
<?php foreach($country as $count_id): ?>
<option value="<?php $count_id -> id;?>" name="country"> 
<?php echo $count_id -> name;?> </option>
</optgroup>
<?php endforeach; ?>
<?php } ?>
</optgroup>
</select>
</div>

(Controller)

$profile -> country_id = $request -> country;



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire