php - 为什么我的 Bootstrap 模态窗口无法在 php 上运行?当我尝试打开模式窗口时,它不会显示

标签 php mysql html-table modal-dialog bootstrap-modal

我创建了一个带有太多按钮的表格:删除按钮和另一个“查看”按钮 其他配置文件”(此按钮显示模态,并且按钮循环 整个 table 。它应该显示模式,但它不显示 一些原因。我已经尽可能地纠正了错误,但 按钮不显示模式)

function crea_tabla_foros() {    
    /* here I create a query to select my tables*/
    /*I execute it */       
    $rs = ejecutar($q);
    /*I create a while to make the table dynamic */ 
    $contenido = " ";
    while($r = mysqli_fetch_array($rs)) {
    /*calling mysql*/
        $id_foro = $r['id_foro'];
        $nombreforo = $r['nombreforo'];
        $usuario = $r['usuario'];
        $comentarios = $r['comentarios'];
        $id_comentarios = $r['id_comentarios'];  
        $contenido .= "
            <tr>
                <td style='color:black;'>$nombreforo</td>
                <td style='color:black;'>$usuario</td>
                <td style='color:black;'>$comentarios </td>
                <td>
                    <form method='post' action='bak_foros.php'>
                        <input type='hidden' name='id_comentarios' value='$id_comentarios'>
                        <input class='trash' type='submit' name='eliminar' value='Eliminar'>
                    </form>
                    /*HERE IS THE BUTTON FOR THE MODAL*/
                    <button data-toggle='modal' data-target='#ver'>VER</button>**
                </td>
            </tr>"

这是应该显示的模式,它位于 主体但在 PHP 函数之外:

<div id="ver" class="modal fade" role="dialog">
  <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title">PERFILES DE PARTICIPANTES</h4>
      </div>
      <div class="modal-body">
      <p></p>
      </div>

      <div class="modal-footer">
          <button class="publicar">PUBLICAR</button>
        <button type="button" class="btn btn-default" data-dismiss="modal">CANCELAR</button>
      </div>
    </div>

  </div>
</div>   

Here is the link click here

最佳答案

您已将模态框放置在以下 div 中

<div class="filterDiv pendientes">

它有一个 css display:none 属性。将其放在该 div 之外,它应该会显示。

关于php - 为什么我的 Bootstrap 模态窗口无法在 php 上运行?当我尝试打开模式窗口时,它不会显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50294649/

相关文章:

php - 为什么 PHP 不抛出解析错误?

MySql - 客户端超时

javascript - 如何在向函数发送参数时删除单击的行?昏死

php - 设置对 PHP 函数的调用,将 POST 变量作为参数,作为 HTML 表单操作

php - 仅当 SQL 中同一日期内时才进行 GROUP BY latlong

php - HTTP Post 到 MySQL 插入空白行

mysql - SQL - 连接表

html - 防止 HTML 表格调整大小溢出

javascript - 将动态数据保存到 localStorage 并在加载 .html 时将此数据加载到 html 表中

php - 发生数据库错误 1452