feat: add comment field under every question

This commit is contained in:
Anton
2026-05-12 21:53:19 +03:00
parent 0a634b6e20
commit e25e18af45
2 changed files with 25 additions and 0 deletions
+15
View File
@@ -44,6 +44,21 @@
border-color: #2d6a4f;
background: #f0faf4;
}
.question-comment {
margin-top: 10px;
width: 100%;
padding: 8px 12px;
border: 1.5px dashed #ddd;
border-radius: 8px;
font-size: 0.85rem;
font-family: inherit;
color: #555;
background: #f9f9f9;
resize: vertical;
min-height: 44px;
}
.question-comment::placeholder { color: #bbb; font-style: italic; }
.question-comment:focus { outline: none; border-color: #2d6a4f; background: #fff; }
.other-input {
margin-top: 6px;
margin-left: 28px;
+10
View File
@@ -1,6 +1,16 @@
const TOTAL = 24;
document.addEventListener('DOMContentLoaded', function () {
// Добавить поле комментария под каждый вопрос
document.querySelectorAll('.question[data-index]').forEach(q => {
const name = (q.querySelector('[name]') || {}).name || '';
const ta = document.createElement('textarea');
ta.className = 'question-comment';
ta.name = name + '_comment';
ta.placeholder = 'Свой комментарий или уточнение (необязательно)...';
q.appendChild(ta);
});
updateProgress();
document.getElementById('client_email').addEventListener('input', function () {