私は今、私は古典的な甘いアラートを使用して確認(送信)する方法
を削除したいページの下部$(document).on('submit', '[id^=tableDelete_]' , function() {
return callAjax($(this).serialize());
});
function callAjax(data) {
$.ajax({
type : 'POST',
url : 'call/page.php',
data : data,
success : function(data) { ... },
error: function(data) { ... }
});
return false;
};
に、この後、各行は、このフォームで
<form id="tableDelete_1">
<input type="hidden" name="tipo" value="delete" />
<input type="submit" name="send" value="Delete" class="btn btn-danger btn-xs" onClick="return confirm(`Are you sure?`)" />
</form>
<form id="tableDelete_2">
<input type="hidden" name="tipo" value="delete" />
<input type="submit" name="send" value="Delete" class="btn btn-danger btn-xs" onClick="return confirm(`Are you sure?`)" />
</form>
を削除ボタンを持つテーブルを持っています
とsweetalertを使用してください... 私はこの機能でポップアップだけを表示したいときにちょっとした問題があります
$(document).on('submit', '[id^=tableDelete_]' , function() {
swal({
title: "Are you sure?",
text: "You will not be able to recover this imaginary file!",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, delete it!",
closeOnConfirm: false
},
function(){
swal("Deleted!", "Your imaginary file has been deleted.", "success");
});
};
ポップアップが
は私はあなたがデフォルトを防ぐために必要
e.preventDefault()でポップアップが表示されません...返品虚偽でOK! 残りの機能をありがとう – FireFoxII