简体   繁体   English

使用button type =“submit”而不是input - laravel

[英]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"> 所以我不能使用<input type="submit">

<button type="submit" class="btn btn-success">
                <i class="fa-trash"></i> delete
</button>

View on laravel 在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 这不是在按钮内部渲染html

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 唯一需要注意的是该类型设置为提交

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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