Reputation: 277
I have this code on my view
{!! Form::select('room', $rooms, Input::old('room'), array('class' => 'form-control')) !!}
and this on my controller
$rooms = array('' => 'Select Room') + $rooms;
I wanted the first option to be selected and disabled which is the "Select Room". I tried to put it also in array and it didn't work.
Upvotes: 1
Views: 2096
Reputation: 5582
If you want to disable only one option from select list then you can do this in html like this:
<select>
<option value="volvo" disabled>Volvo</option>
<option value="saab">Saab</option>
<option value="vw">VW</option>
<option value="audi">Audi</option>
</select>
This will disable first option disabled.
For reff. http://www.w3schools.com/tags/att_option_disabled.asp
Upvotes: 0