这里是所有代码:
$(document).ready(function() {
$("#dialog-form").dialog({
autoOpen: false,
closeOnEscape: false,
draggable: true,
height: 'auto',
width: 'auto',
modal: true,
buttons: {
"Ok": function() {
var fok = $('#montantrecu').validationEngine('validate');
if (!fok) {
$(this).dialog("close");
$.ajax({
type: "POST",
url: '<%=ResolveUrl("~/Services/Services.asmx/Facture")%>',
data: "{'IdMembre':'" + $('#hdId').val() + "', MontantFacture': '" + $('#montantrecu').text + "' }",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
success: function (response) {
alert("Ok");
},
failure: function (response) {
alert("failure");
},
error: function (request, status, error) {
alert(request.responseText);
}
});
}
},
"Annuler": function() {
$(this).dialog("close");
}
}
});
$("#lbCreer").click(function (e) {
e.preventDefault();
$("input:checked").each(function() {
var id = this.value;
$("#hdId").val(id);
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: '<%=ResolveUrl("~/Services/Services.asmx/GetNomPrenom")%>',
data: "{'IdMembre':'" + id + "'}",
dataType: "json",
async: false,
success: function (response) {
$("#liNom").text(response.d);
},
failure: function (response) {
alert("failure");
},
error: function (request, status, error) {
alert(request.responseText);
}
});
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: '<%=ResolveUrl("~/Services/Services.asmx/GetMontantCotisation")%>',
data: "{'IdMembre':'" + id + "'}",
dataType: "json",
async: false,
success: function (response) {
$("#montantrecu").val(response.d);
},
failure: function (response) {
alert("failure");
},
error: function (request, status, error) {
alert(request.responseText);
}
});
$("#dialog-form").dialog("open");
});
alert('toto');
});
});
你可以'对话框打开跳出循环后返回FALSE',但为什么,如果你想打开对话框后,打破了你需要一个循环? – 2014-10-30 19:47:48
我打开对话框,然后用户确认服装和当用户点击确定按钮,我做了一个过程。我想为所有的复选框做好准备。我不知道我的英语 – Eric 2014-10-30 19:58:32