Add icon to Laravelcollective submit button

我怕爱的太早我们不能终老 提交于 2020-04-29 09:03:30

问题


I'm trying to add a trash icon to submit button and I tried this :

{!! Form::submit('', ['class' => 'btn btn-warning btn-sm fa fa-trash']) !!}

but the icon won't show. How to solve this ? thanks in advance!


回答1:


Try to use Form::button instead of Form::submit:

{{ Form::button('<i class="fa fa-trash"></i>', ['type' => 'submit', 'class' => 'btn btn-warning btn-sm'] )  }}



回答2:


You can try too with:

Example to input type button:

{{ FORM::button('<i class="glyphicon glyphicon-trash" aria-hidden="true"></i> Text button',['class'=>'button button-red','type'=>'button','id'=>'id-button']) }}



回答3:


there are not possible try it laravel collective form given very competition

<button class='btn btn-primary' type='submit' value='submit'>
<i class='fa fa-save'> </i> Save



来源:https://stackoverflow.com/questions/41211522/add-icon-to-laravelcollective-submit-button

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