Commit 58ac4b13 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add callback to submit_form

parent 49629558
......@@ -52,7 +52,7 @@ function testRequired(e,formid) {
// Gets form elements, submits them to a url via post, and waits for a
// JSON response containing the result of the submission.
function submitForm(formid,url) {
function submitForm(formid,url,callback) {
if (typeof(tinyMCE) != 'undefined') {
tinyMCE.triggerSave();
}
......@@ -73,6 +73,7 @@ function submitForm(formid,url) {
d.addCallback(function (result) {
var data = evalJSONRequest(result);
displayMessage({'message':data.message,'type':data.success});
callback();
});
d.addErrback(function() { displayMessage(get_string('unknownerror'),'error'); });
displayMessage({'message':get_string('processingform'),'type':'info'});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment