function mod_project(base, pid) { // Temporarily disable the dynamic selects while we retrieve the new info. // The newly loaded selects will be enabled by default. $("select[@id=edit-rid]").attr("disabled", "disabled"); $("select[@id=edit-component]").attr("disabled", "disabled"); // Get existing component seting. var cid = $("select[@id=edit-component]").val(); cid = Drupal.encodeURIComponent(cid); // Get existing version label. var nid = $("select[@id=edit-rid]").val(); var rid = $("select[@id=edit-rid] option[@value=" + nid + "]").text(); rid = Drupal.encodeURIComponent(rid); // Ajax GET request. $.ajax({ type: "GET", url: base + pid + '/' + cid + '/' + rid, success: function (data) { // Parse back result var result = Drupal.parseJson(data); $("#project-issue-rid").empty().append(result['rid']); $("#project-issue-component").empty().append(result['component']); }, error: function (xmlhttp) { alert('An HTTP error '+ xmlhttp.status +' occured.\n'+ url); } }); }