|
|
|
@ -16,16 +16,26 @@ $(document).ready(function () { |
|
|
|
}) |
|
|
|
}) |
|
|
|
$("form").on("submit", function(e){ |
|
|
|
$("form").on("submit", function(e){ |
|
|
|
e.preventDefault(); |
|
|
|
e.preventDefault(); |
|
|
|
var url = $(this).attr("action"), |
|
|
|
var $this = $(this), |
|
|
|
form = $(this).serialize(); |
|
|
|
url = $this.attr("action"), |
|
|
|
|
|
|
|
form = $this.serialize(), |
|
|
|
|
|
|
|
$modalBody = $this.parent(), |
|
|
|
|
|
|
|
$message = $("<p class='success-message'></p>"), |
|
|
|
|
|
|
|
$button = $this.closest(".modal-dialog").find(".btn"); |
|
|
|
$.post( |
|
|
|
$.post( |
|
|
|
url, |
|
|
|
url, |
|
|
|
form, |
|
|
|
form, |
|
|
|
function(data){ |
|
|
|
function(data){ |
|
|
|
console.log(data); |
|
|
|
console.log(data); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(data.message.length){ |
|
|
|
|
|
|
|
$this.fadeOut("fast",function(){ |
|
|
|
|
|
|
|
$button.fadeOut(); |
|
|
|
|
|
|
|
$message.text(data.message).appendTo($modalBody); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
console.log("!!!submit"); |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}); |
|
|
|
}); |
|
|
|
|