我无法删除好的评论,它总是删除最后一个。问题jQuery和PHP在对话框中多次提交
我的JS:
$(function() {
$(".delete").click(function() {
$("#delete-confirm").dialog("open");
});
$("#delete-confirm").dialog({
autoOpen: false, modal: true, width: '600px', show: 'fade',
buttons: {
"Confimer": function() {
$(this).dialog("close");
$('.form-comment').append('<input type="hidden" name="delete" />');
$(".form-comment").submit();
},
"Annuler": function() {
$(this).dialog("close");
}
}
});
});
而在PHP:
<?php
foreach ($commentManager->getList() as $comment) { ?>
<form class="form-comment" method="post" style="display: inline;">
<input type="hidden" name="id" value="<?php echo $comment['id']; ?>" />
</form>
<?php } ?>
如何提交窗体具有良好ID withtout把我的jQuery代码的PHP页面的中间?
Thx寻求帮助。 – kesm0 2013-03-08 04:00:31