Skip to content

Commit

Permalink
blocked form input if the tenantID is not present. fixes #36 AND #34
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Oct 16, 2021
1 parent db4a315 commit 8b180b8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions js/tenantlist.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
$(document).ready(function () {
$(":input").prop("disabled", true);

let searchParams = new URLSearchParams(window.location.search)
if (searchParams.has('Tenantfilter')) {
var TenantID = searchParams.get('Tenantfilter')
} else {
$(":input").prop("disabled", true);
$("#exampleDataList").prop("disabled", false);
}

var dataList = document.getElementById('datalistOptions');
Expand All @@ -16,7 +19,7 @@ $(document).ready(function () {
},
'success': function (data) {
data.forEach(function (item) {
$(":input").prop("disabled", false);
$("#exampleDataList").prop("disabled", false);
var option = document.createElement('option');

option.value = item.displayName;
Expand All @@ -31,7 +34,7 @@ $(document).ready(function () {
},
'error': function (xhr, ajaxOptions, thrownError) {
$("#exampleDataList").val('Could not load tenants: Failed to connect to API:' + thrownError);
$(":input").prop("disabled", false);
$("#exampleDataList").prop("disabled", false);
}

});
Expand Down

0 comments on commit 8b180b8

Please sign in to comment.