Commit 02d2b896 authored by Leigh B Stoller's avatar Leigh B Stoller

A couple of things I forgot in the new form code. 1) "general" errors that

are not associated with a form control and 2) pass the embedded flag along
when submitting forms.
parent 32a878d6
......@@ -128,6 +128,19 @@ define(['underscore', 'js/quickvm_sup'],
}
}
});
/*
* Deal with a "general" error. Some of the forms have a specific
* spot for this.
*/
if (errors && _.has(errors, "error")) {
if ($('#general_error').length()) {
$('#general_error').html(_.escape(errors["error"]));
}
else {
console.info("General error: " + errors["error"]);
alert(errors["error"]);
}
}
}
function ClearFormErrors(form) {
......@@ -175,7 +188,9 @@ define(['underscore', 'js/quickvm_sup'],
var xmlthing =
sup.CallServerMethod(null, route, method,
{"formfields" : formfields,
"checkonly" : 1});
"checkonly" : 1,
"embedded" : window.EMBEDDED,
});
xmlthing.done(checkonly_callback);
}
......@@ -202,7 +217,9 @@ define(['underscore', 'js/quickvm_sup'],
var xmlthing =
sup.CallServerMethod(null, route, method,
{"formfields" : formfields,
"checkonly" : 0});
"checkonly" : 0,
"embedded" : window.EMBEDDED,
});
xmlthing.done(submit_callback);
}
......
......@@ -10,6 +10,7 @@
</div>
<% } %>
<div class='panel-body'>
<span id="general_error" style="color:red;"></span>
<form id='create_dataset_form'
class='form-horizontal' role='form'
method='post' action=create_dataset.php'>
......
......@@ -102,6 +102,7 @@
</div>
<% } %>
<div class='panel-body'>
<span id="general_error" style="color:red;"></span>
<form id='quickvm_create_profile_form'
class='form-horizontal' role='form'
data-format="wide"
......
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