diff --git a/static/js/committeemeeting_detail.js b/static/js/committeemeeting_detail.js index f4e71585..697f5e87 100644 --- a/static/js/committeemeeting_detail.js +++ b/static/js/committeemeeting_detail.js @@ -53,6 +53,10 @@ $(function () { }); $("input[name$='mk_name']").autocomplete(options_mk); $("input[name$='mk_name_to_remove']").autocomplete(options_mk); + $("input[name$='mk_name'], input[name$='mk_name_to_remove']").keydown(function () { + $(this).siblings("input[name$='mk_id']").val(''); + $(this).siblings("input[type$='submit']").attr('disabled', 'disabled'); + }); var options_lobbyists = { @@ -61,8 +65,17 @@ $(function () { maxHeight: 400, width: 150, deferRequestBy: 100, //miliseconds + onSelect: function (value, data, me) { + me.siblings("input[name$='lobbyist_id']").val(data); + me.siblings("input[type$='submit']").removeAttr('disabled'); + }, }; $("input[name$='lobbyist_name']").autocomplete(options_lobbyists); + $("input[name$='lobbyist_name_to_remove']").autocomplete(options_lobbyists); + $("input[name$='lobbyist_name'], input[name$='lobbyist_name_to_remove']").keydown(function () { + $(this).siblings("input[name$='lobbyist_id']").val(''); + $(this).siblings("input[type$='submit']").attr('disabled', 'disabled'); + }); $(".annotation-content").each(function () { var annoid = $(this).attr("id").split("-")[1]; diff --git a/templates/committees/committeemeeting_detail.html b/templates/committees/committeemeeting_detail.html index 934dacc7..17a3d489 100644 --- a/templates/committees/committeemeeting_detail.html +++ b/templates/committees/committeemeeting_detail.html @@ -68,26 +68,28 @@

{% trans "MKs attended" %}

- +
{% csrf_token %} - +
{% csrf_token %} - + +
{% csrf_token %} - - + + +
{% endif %}