Skip to content
Snippets Groups Projects
Commit f8ae0a97 authored by xamgore's avatar xamgore
Browse files

FIX: locking the select subject menu, when faculty is chosen.

If you choose any faculty at the menu, it is possible to catch drop down menu with subjects at the previous stage. Now that behaviour is fixed.

Improves usability.
parent a9011fe7
Branches
Tags
No related merge requests found
......@@ -15,8 +15,9 @@ $(function() {
var optionVal = parseInt($("select.SelectFaculty").children("option:selected").val());
if (optionVal <= 0)
return;
var g_facultyID = optionVal;
selectSubject.attr("disabled", true);
var g_facultyID = optionVal;
$.post(
g_URLdir + "handler/map/GetSubjectsList",
{
......@@ -25,15 +26,18 @@ $(function() {
function(data)
{
selectSubject.select2("val", "");
selectSubject.attr("disabled", true);
data = (data !== "") ? $.parseJSON(data) : {};
var jProto = $($.parseHTML("<option></option>"));
selectSubject.html("");
$.each(data, function (key, cur) {
jProto.html(cur.Title).val(cur.ID);
selectSubject.append(jProto.clone());
});
});
}
).always(
function(success)
{
selectSubject.removeAttr("disabled");
}
);
......
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