我是新手。我正在转换一个包含帖子表单的工作 Bootstrap 模式。使用带有 ID 的按钮打开模式。打开时,它始终显示在 SQL while 语句结果列表中找到的第一条记录的 FORM 内容。我将模式从 id 更改为 class。我现在用类按钮而不是 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.
蓝山帝景