$(function () { $("[master]").each(function() { var sub = $(this); var master = $("#f_" + $(this).attr("master")); var sel = sub.find("select"); var chFunc = function() { sub.find(".subLoader").show(); sub.find(".fishText").hide(); sel.show(); var val = master.val(); if (val) $.post("/api/" + objEdit + "/subList", {"field": sub.attr("id").substr(4), "value": val, "ownerField": sub.attr("owner"), "loadData": sub.attr("loadData"), "nameField": sub.attr("field")}, function(data) { sel.html(""); $(data).find("line").each(function() { var text = "