Add icon to Laravelcollective submit button

17.4k views Asked by At

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!

3

There are 3 answers

2
MisterDebug On BEST ANSWER

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'] )  }}
0
Bhargav Raviya On

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

0
C47 On

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']) }}