Add Class to select element on Laravel

这一生的挚爱 提交于 2019-12-12 08:09:54

问题


I have this problem, I can't find the way to add class attribute in this Dropdown box

{{Form::select('bancada', Bancada::lists('nombre','idBancada'))}}

I have tried various syntax, but can not get it to work.

Any suggestions? Thanks


回答1:


Use the forth parameter to add attributes to your element.

{{Form::select('bancada', Bancada::lists('nombre','idBancada'), null, ['class' => 'my_class'])}}

Take a look at the source ($options is the same as attributes for your element).




回答2:


{{ Form::select('status', $statusList, null, array('class' => 'form-control')) }}

In above example you can add class as fourth parameter



来源:https://stackoverflow.com/questions/26831509/add-class-to-select-element-on-laravel

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!