19 lines
576 B
JavaScript
19 lines
576 B
JavaScript
|
$(function(){
|
||
|
function initEnrolment(elt) {
|
||
|
elt = $(elt);
|
||
|
elt.find("form.enrolment").on("submit", function() {
|
||
|
elt.addClass("sending-request");
|
||
|
var form = this;
|
||
|
var url = form.action + "?ajax";
|
||
|
$.post(url, $(form).serialize(), function(data) {
|
||
|
elt.html(data);
|
||
|
elt.removeClass("sending-request");
|
||
|
initEnrolment(elt);
|
||
|
});
|
||
|
return false;
|
||
|
});
|
||
|
}
|
||
|
|
||
|
$.each($(".activity-summary"), function(i, item) { initEnrolment(item) });
|
||
|
});
|