Laravel 5.6如何填充模态窗口中的select

时间:2018-04-26 20:37:16

标签: laravel-5

我在使用从数据库检索的数据填充模态窗口上的选择时遇到问题,我想知道是否使用Jquery进行更短的防弹方式。

select in modal window

Index.blade.php

<a href="{{ url('beneficios/create') }}" class="btn btn-primary mb-3"    
role="button" data-toggle="modal" data-target="#modalbeneficio" 
id="crear-beneficio">Crear Beneficio</a

提前致谢!

1 个答案:

答案 0 :(得分:0)

bootstrap official docs中所述,只需在index.blade.php模式代码的某处放置:

<div class="modal" tabindex="-1" role="dialog" id="modalbeneficio">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">Modal title</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <!-- Insert here whatever HTML you need to be displayed inside the modal --!>
      </div>
    </div>
  </div>
</div>