2
Hello, gentlemen I’m having trouble putting a message waiting for the user when they click save button and stay waiting for the return of the server. I am using Jquery Dialog and Partial View to load an html from the server into a div. Someone has an idea?
$("#NovoDialog").html("").dialog("option", "title", "Novo").load("/Teste/Create", function () { $("#NovoDialog").dialog("open"); });
$("#NovoDialog").dialog({
autoOpen: false, width: 520, height: 550, modal: true,
buttons: {
"Salvar": function (evt) {
var buttonDomElement = evt.target;
$(buttonDomElement).attr('disabled', true);
if ($("#FormCadastro").validate().form()) {
$.post("/RegistroAcaoCorretiva/Save",
$("#FormCadastro").serialize(),
function (data) {
if (data.success) {
$("#NovoDialog").dialog("close");
location.reload();
} else {
$("#NovoDialog").html(data);
$.validator.unobtrusive.parse($("#NovoDialog"));
}
});
} else {
$(buttonDomElement).attr('disabled', false);
}
},
Cancelar: function () { $(this).dialog("close"); }
}
});
<div id="progressbar">
<h2>TESTE</h2>
<div id="NovoDialog" title="" class="Hidden"></div>
</div>
Thanks Gypsy that way works.
– Zica