Reputation: 589
I am using the HtmlServiceProvider
in laravel 5.1 to build my form , I want to set the selected option in select dropdown list tag when I get the data from my model class
My code so far:
{!! Form::model($advertisment,['url'=>'dashboard/edit/advertisment']) !!}
{!! Form::select('Gender', [""=>'Select Gender',"Male"=>'Male', "Female"=>'Female'],0, ['class' => 'form-control', 'id' => 'form_control_6' ,'required']) !!}
{!! Form::close() !!}
Upvotes: 0
Views: 140
Reputation: 556
If you don't want to override the value from the model, pass in null
Upvotes: 0
Reputation: 1373
Set the 0 parameter to "Male" for example and you will figure it out
Upvotes: 2