Select box with first option empty

后端 未结 15 1066
情深已故
情深已故 2021-02-01 16:29

Does anybody know how can I set in my select box the first option to empty value?

I\'m getting the data from my DB, and I would like to set the option by default as \"P

15条回答
  •  -上瘾入骨i
    2021-02-01 16:36

    { !! Form::select('country', $country, 'GB', ['id' = > 'country', 'class' = > 'form-control select2me']) !!}
    

    Here $country is array that contains many countries , in this array is "great britain" by the id "GB" which will be selected by default.

提交回复
热议问题