var selectList = []; $(document).ready(function () { loadLangs(); $("#addModal").on("show.bs.modal", function (e) { $("#addLangTab").tab("show"); $(".addField").val(""); buildLangSelect(); }).on("shown.bs.modal", function (e) { $("#txtLangName").focus(); }); $("#btnAddItem").click(addNewItem); $(".clearLangSelect").click(function () { $(".langSelect").val([]); }); $(".editChk").change(checkBoxChange); }); function buildLangSelect() { $.ajax({ url: "lang.php", type: "GET", success: addSelectLangs, error: displayError }); } function addSelectLangs(langList) { var selectors = $(".langSelect"); selectors.empty(); langList.forEach(function (cur) { $("