选择第一个选项框为空 [英] Select box with first option empty
本文介绍了选择第一个选项框为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从数据库中获取数据,我想将默认设置为请选择一个选项。
解决方案
我发现'default'=>'请选择'
HTML5必需属性。
这个工作:
Form :: select('user',[null =>'请选择' ] + $ users)
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 "Please select one option".
解决方案
I found that 'default'=>'Please select'
doesn't work with the HTML5 required attribute.
This does work:
Form::select('user',[null=>'Please Select'] + $users)
这篇关于选择第一个选项框为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文