function setButtonStates(element) { const form = document.getElementById('filesForm'); if (canEdit.System) { let disabled = true; const files = len=form.elements['files[]']; if (files) { for (let i=0, len=files.length; i