0
我想要一个处理程序附加到删除按钮click
事件,会弹出一个确认模式。 当确认它应该重定向到process.php?cid=$cid
。 但是,如何将变量$cid
传递给模态删除?如何传递变量来引导模式确认按钮使用jQuery
数据列表:
<?php
foreach($getChannel as $data) {
?>
<div class="btn-group btn-group-solid">
<a class="btn red" data-toggle="modal" href="#small" id="<?php echo $cid?>">
<i class="fa fa-trash"></i> Delete </a>
</div>
<?php
}
?>
模态:
<div class="modal fade bs-modal-sm" id="small" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title">Confirm</h4>
</div>
<div class="modal-body">
Are you sure to delete?
</div>
<div class="modal-footer">
<button type="button" class="btn green" data-dismiss="modal" id="delcancel">cancel</button>
<button type="button" class="btn red" id="del" onclick="process.php?cid=$cid">Go Delete</button>
</div>
</div>
</div>
</div>
如何使用jQuery收到$ CID变量?
<button type="button" class="btn red" id="del" onclick="process.php?cid=$cid">Go Delete</button>
我希望我能标志一个问题的两倍。你的问题已经被问:http://stackoverflow.com/questions/34693206/how-can-i-pass-a-php-variable-to-bootstrap-modal?rq=1 [传的 –
可能的复制PHP变量模态Twitter的引导不工作(http://stackoverflow.com/questions/23467669/passing-php-variable-to-modal-twitter-bootstrap-not-working) –
的可能的复制[如何通过$ \从一个链接到一个bootstrapmodal _GET变量?](http://stackoverflow.com/questions/32433765/how-to-pass-get-variables-from-a-link-to-a-bootstrapmodal) – Shehary