|
@@ -13,6 +13,13 @@
|
|
|
{% csrf_token %}
|
|
|
{% include "sharix_admin/include/form.html" %}
|
|
|
|
|
|
+ <div class="form-check text-muted">
|
|
|
+ <input type="checkbox" class="form-check-input" id="checkbox-fourteen-years">
|
|
|
+ <label class="form-check-label" for="checkbox-fourteen-years">
|
|
|
+ Мне есть 14 лет
|
|
|
+ </label>
|
|
|
+ </div>
|
|
|
+
|
|
|
<div class="form-check text-muted">
|
|
|
<input type="checkbox" class="form-check-input" id="checkbox-user-agreement">
|
|
|
<label class="form-check-label" for="checkbox-user-agreement">
|
|
@@ -34,13 +41,17 @@
|
|
|
<script>
|
|
|
// Логика, запрещающая нажатие на кнопку "Зарегистрироваться", пока пользователь не согласится с "Пользовательским соглашением"
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
|
- const checkboxEl = document.getElementById('checkbox-user-agreement');
|
|
|
+ const checkboxEls = [
|
|
|
+ document.getElementById('checkbox-fourteen-years'),
|
|
|
+ document.getElementById('checkbox-user-agreement')
|
|
|
+ ];
|
|
|
const submitBtnEl = document.getElementById('btn-submit-signup');
|
|
|
|
|
|
- // Обработчик события изменения состояния чекбокса
|
|
|
- checkboxEl.addEventListener('change', function() {
|
|
|
- if (checkboxEl.checked) submitBtnEl.removeAttribute('disabled');
|
|
|
- else submitBtnEl.setAttribute('disabled', 'disabled');
|
|
|
+ checkboxEls.forEach(checkboxEl => {
|
|
|
+ checkboxEl.addEventListener('change', function() {
|
|
|
+ if (checkboxEls.every(el => el.checked)) submitBtnEl.removeAttribute('disabled');
|
|
|
+ else submitBtnEl.setAttribute('disabled', 'disabled');
|
|
|
+ });
|
|
|
});
|
|
|
});
|
|
|
</script>
|