내가 jQuery를 사용하여 확인 대화 상자를 할 노력하고있어,하지만 양식이 전혀 제출되지 않습니다, 이것은 내가 가진 것입니다 :JQuery와의 대화 : 버튼 제출에 클릭을 확인하는 것은
<script type="text/javascript">
var currentForm;
$(function() {
$("#dialog-confirm").dialog({
resizable: false,
height: 140,
modal: true,
autoOpen: false,
buttons: {
'Delete all items': function() {
currentForm.submit();
$(this).dialog('close');
},
Cancel: function() {
$(this).dialog('close');
}
}
});
});
function ask() {
currentForm = $(this).closest('form');
$("#dialog-confirm").dialog('open');
}
</script>
<form ... >
<input type="submit" value="delete" onclick="ask();return false;" />
</form>
문제는 내가 그것들 안에 삭제 버튼이있는 형태가 많다는 것이다. 단지 숨겨진 입력이다. '이 양식의 차이를 만드는 것 – Omu
양식에 다른 이름/ID를 부여 할 수 있습니다. 이름에 양식 + theId가 포함될 수 있습니다. – Omu
@Omu - "currentForm ='$ (this) .closest ('form')'를 호출 한 다음, delete 버튼의 핸들러에서'currentForm.submit()'을 호출하고, ID가 필요 없다 ... 클래스 또는 애트리뷰트 선택자를 사용하기 위해 delete 클릭 핸들러를 변경하면된다. –