我是新手。我正在转换一个包含发布表单的工作 Bootstrap 模式。使用带有 Id 的按钮打开模式。它总是在打开时显示在 SQL while 语句结果列表中找到的第一条记录的 FORM 内容。我将模态从 id 更改为一个类。我现在用类按钮而不是 id 按钮打开它。但是现在它一直显示第二条记录的表单内容。如果我从模态中取出表格,它可以正常工作并显示正确的内容。accept-btn 打开模式。('.confirm-body') 包含模态内容表单。请感谢一些帮助。
<!-- Opens modal is outside the modal-->
<a class="accept-btn">Accept</a>
<!-- The Modal -->
<div class="modal">
<!-- Modal content -->
<div class="modal-content animate confirmarea-size">
<div id="topblue-border1" class="topblue-border1"></div> <!-- topblue border End -->
<!-- Popup buttons Start -->
<div class="confirm-body boxshadow" style="display:none;">
<form class="whatever" action="" method="">
<input type="hidden" class="whatever" name="" value="<?php echo whatever?>">
<input type="hidden" class="whatever" name="" value="<?php echo whatever?>">
<input type="hidden" class="whatever" name="" value="<?php echo whatever?>">
<div class="ajax-response"></div>
<a><div id="css-btn" class="confirm-btn">Accept</div></a>
<a><div id="css-btn" class="cancel-btn">Cancel</div></a>
<a><div id="css-btn" class="nextstage-btn">OK</div></a>
</form>
</div> <!-- Popup Confirm Section END -->
</div> <!-- End of The Modal Content -->
</div> <!-- End of The Modal -->
1st Option Button script
<script>
// Accept button Opens the Modal .
$(document).ready(function() {
$('.accept-btn').click(function(event) {
$('.modal').show();
$('.confirm-body').show();
});
});
</script>
2nd Option button script. I want to try something like this but I dont know how to code it and close it correctly. each recored has a record Id field. I want to relate the modal to the record id.
拉风的咖菲猫
相关分类