mirror of
https://github.com/fspc/workstand.git
synced 2025-02-23 09:13:23 -05:00
Enable submit button once everything is agreed to.
This commit is contained in:
parent
0c99334cd5
commit
4c8b60b0ea
@ -154,5 +154,22 @@
|
|||||||
this.parentNode.classList.add('is-dirty');
|
this.parentNode.classList.add('is-dirty');
|
||||||
this.value = renewedAt.time.format('YYYY-MM-DD');
|
this.value = renewedAt.time.format('YYYY-MM-DD');
|
||||||
})
|
})
|
||||||
|
|
||||||
|
var responsibilities = [
|
||||||
|
document.getElementById('{{ form.safe_space.id_for_label }}'),
|
||||||
|
document.getElementById('{{ form.respect_community.id_for_label }}'),
|
||||||
|
document.getElementById('{{ form.give_back.id_for_label }}'),
|
||||||
|
document.getElementById('{{ form.respect_shop.id_for_label }}')
|
||||||
|
];
|
||||||
|
var checkResponsiblities = function () {
|
||||||
|
allAgreed = responsibilities.every(function (checkbox) {
|
||||||
|
return checkbox.checked
|
||||||
|
});
|
||||||
|
var submitButton = document.getElementById('submit');
|
||||||
|
submitButton.disabled = !allAgreed;
|
||||||
|
};
|
||||||
|
responsibilities.forEach(function (checkbox) {
|
||||||
|
checkbox.addEventListener('click', checkResponsiblities)
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
Loading…
x
Reference in New Issue
Block a user