feat: add comment field under every question
This commit is contained in:
@@ -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
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user