我的表格是,在储蓄之前,我需要向用户展示确认的方言。
我已经这样做,拦截了提交职务的表格:
$("#my_form").submit(function(e) {
if ($("#id").val() > 0) {
var $dialog = $( <div></div> )
.html( Are you sure? )
.dialog({
autoOpen: false,
title: Save New Invoice ,
modal: true,
buttons: {
"OK": function() {
$dialog.dialog( close );
$("#my_form").submit();
},
Cancel: function() {
$(this).dialog("close");
}
}
});
$dialog.dialog( open );
e.preventDefault();
return false;
}
});
但是,科索沃荷兰语并没有正确发挥作用,方言没有结束,表格也没有提交。
如果我改变科索沃局的职能如下,那么方言就会关闭,并显示警示。
"OK": function() {
$dialog.dialog( close );
alert( form will be submitted );
},
因此,我猜测,这与<代码>$(“#my_form”)有关,即:方法。