Reputation: 476
I want to get the selected value from a drop down list in a controller method. The drop down list :
{{ Form::select('Organization', $organization_list ,Input::old('Organization'), array('class' => 'form-control')) }}
$organization_list is an array of organizations.. I have tried to catch the selected item of this drop down list in a controller as follows:
Input::get('Organization');
But it gives me the array index instead of the real organization name..But the real organization name is shown in drop down list.. does anyone have a solution?
Upvotes: 1
Views: 550
Reputation: 3477
Pass an associative array To Form::select
as the second argument
$organization_list = array_combine($organization_list, $organization_list); //Copies the array values to keys
{{ Form::select('Organization', $organization_list ,Input::old('Organization'), array('class' => 'form-control')) }}
Upvotes: 2