Commit f1dee7ee authored by Jonny Bradley's avatar Jonny Bradley

[FIX] trackers: Don't try and make options on dynamic lists when empty

parent 6bdf7e4c
......@@ -88,15 +88,17 @@ $("select[name=ins_' . $this->getOption(2) . ']").change(function(e, val) {
function(data, status) {
$ddl = $("select[name=' . $this->getInsertId() . ']");
$ddl.empty();
$.each( data, function (i,v) {
$ddl.append(
$("<option/>")
.attr("value", v)
.text(v)
);
});
if (val) {
$ddl.val(val);
if (data) {
$.each( data, function (i,v) {
$ddl.append(
$("<option/>")
.attr("value", v)
.text(v)
);
});
if (val) {
$ddl.val(val);
}
}
}
);
......
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