简体   繁体   中英

using button type=“submit” instead of input - laravel

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM