簡體   English   中英

如何使用內部 php 代碼顯示引導模式彈出窗口

[英]How to show a bootsrap modal popup using inside php code

我想在 php 條件檢查后顯示這個模態彈出窗口

<div id="myModal65" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">Subscribe our Newsletter</h4>
            </div>
            <div class="modal-body">
                <p>Subscribe to our mailing list to get the latest updates straight in your inbox.</p>
                <form>
                    <div class="form-group">
                        <input type="text" class="form-control" placeholder="Name">
                    </div>
                    <div class="form-group">
                        <input type="email" class="form-control" placeholder="Email Address">
                    </div>
                    <button type="submit" class="btn btn-primary">Subscribe</button>
                </form>
            </div>
        </div>
    </div>
</div>

在這個用於顯示彈出窗口的 php 代碼中。 但是無法顯示。

<?php
    if($intwschdle==1)
           {
      echo "<script type='text/javascript'>$('#myModal65').modal('show');</script>";            
           }
?>

我認為如果默認情況下向您顯示模態並將其放入 php 條件中會更好,例如:

 <?php
if($intwschdle==1){   
?>
<!--full html for modal goes here showing by default - - >
<?php  } ? >

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM