简体   繁体   English

将Bootstrap工具提示添加到表单标签中

[英]Adding Bootstrap tooltips into form label

I trying to make tooltips into laravelcollective 我试图使tooltips成为laravelcollective

<div class="form-group col-sm-4">
  {!! Form::label('exchange_id', 'Exchanges:') !!}
  {!! Form::select('exchange_id', [''=>'Choose Options'] + $exchanges , null, ['class'=>'form-control', 'id'=>'exchange', 'name'=>'exchange_id',  'onchange' => 'all_function()'])!!}
</div>

In the above select box, {!! Form::label('exchange_id', 'Exchanges:') !!} 在上面的选择框中, {!! Form::label('exchange_id', 'Exchanges:') !!} {!! Form::label('exchange_id', 'Exchanges:') !!} I want to put Bootstrap tooltips like, Exchanges ? {!! Form::label('exchange_id', 'Exchanges:') !!}我想添加Bootstrap工具提示,例如Exchanges? : with question mark. :带问号。
How can I do this? 我怎样才能做到这一点?

You can add attribute to label tag, data-toggle="tooltip" and title="Exchanges ?" 您可以将属性添加到label标签, data-toggle="tooltip"title="Exchanges ?"

<div class="form-group col-sm-4">
 {!! Form::label('exchange_id', 'Exchanges:', ['data-toggle' => 'tooltip', 'title' => 'Exchanges ?']) !!}
 {!! Form::select('exchange_id', ['' => 'Choose Options'] + $exchanges, null, ['class' => 'form-control', 'id' => 'exchange', 'name' => 'exchange_id', 'onchange' => 'all_function()'])!!}
</div>

Need bootstrap plugin and use like it 需要bootstrap插件并使用它

$(function () {
  $('[data-toggle="tooltip"]').tooltip()
})

Tooltips: http://getbootstrap.com/docs/4.1/components/tooltips/ 工具提示: http : //getbootstrap.com/docs/4.1/components/tooltips/

Demo: http://jsfiddle.net/xL1vteoj/ 演示: http//jsfiddle.net/xL1vteoj/

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

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