Reputation: 15464
I need to have font awesome image on button label. So i cannot use <input type="submit">
<button type="submit" class="btn btn-success">
<i class="fa-trash"></i> delete
</button>
View on laravel
{{ Form::open(array('method'
=> 'DELETE', 'route' => array('admin.states.destroy', $value->id))) }}
{{ Form::submit(HTML::decode(FA::icon('trash')), array('class'
=> 'actions-line icon-trash','onclick'=>'return confirm("Are you sure?")')) }}
{{ Form::close() }}
This is not rendering html inside button
What is the proper way?
Upvotes: 3
Views: 10573
Reputation: 5874
Something like
Form::button('<i class="fa fa-star"></i> Submit', array(
'type' => 'submit',
'class'=> 'actions-line icon-trash',
'onclick'=>'return confirm("Are you sure?")'
));
Tailor to your taste. The only thing to note is that the type is set to submit
Upvotes: 11