Here is my Select Box, Here All Company will be loaded,
But i want to display the Particular company as default selected which i have it in session.
Here is my Code
$sessioncompany = 'ABCcompany'
$comp[''] = 'Company';
@foreach($company_list as $row)
<?php
$comp[$row->CompanyID] = $row->CompanyName;
?>
@endforeach
{{ Form::select('CompanyID', $comp, '', array('id' => 'seCompanyID')); }}
What i tried is
{{ Form::select('CompanyID', $comp, '', array('id' => 'seCompanyID'), array(id=>$sessioncompany)); }}
But i ended with failure
What is the mistake i am doing and How can i fix that ?
Note : I want it in the native laravel method
$selectedId = ... // get the id from the session
{{ Form::select('CompanyID', $comp, array($selectedId), array('id' => 'seCompanyID')) }}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments