/
vanullio
/
VisitChecker
Обзор
Документация
Войти
/
vanullio
/
VisitChecker
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
patch_version_1.1
templates/action.html
99 строк
3 KB
vanullio
lastest-version
30 апр 2025, 08:40
30 апр 2025, 08:40
c293c54
Код
Авторство
О чём код?
<!DOCTYPE html> <html> <head> <title>Данные посещаемости</title> <style> body { font-family: Arial, sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: top; height: 100vh; background-color: #e8c8d1; } h3 { margin-top: -9px; padding: 10px 20px; font-size: 22px; background: radial-gradient(circle, #e8b7d6, #f28fce); border-radius: 17px; } h2 { margin-top: -1px; padding: 10px 20px; font-size: 40px; background: radial-gradient(circle, #e8b7d6, #f28fce) ; border-radius: 5px; } h1 { font-weight: lighter; margin-right: 750px; margin-top: -450px; font-size: 17px; } a { margin-top: 50px; font-weight: lighter; margin-right: 750px; font-size: 17px; color #000000; text-decoration: none; cursor: pointer; } button { margin-left: 150px; padding: 10px 20px; font-size: 19px; cursor: pointer; border: none; border-radius: 25px; background: linear-gradient(to right, #ff034e, #800080); color: white; transition: background 0.3s; } button:hover { background: linear-gradient(to right, #d40240, #6a006a); } a:hover { color #d666f2; } </style> <script> function validateForm() { const allowedChars = ["Е", "Н", "Б", "О", "З"]; let isValid = true; {% for line in lines %} const inputField = document.querySelector("input[name='status_{{ loop.index0 }}']"); const inputValue = inputField.value.toUpperCase(); // Приводим к верхнему регистру для удобства if (inputValue !== "" && !allowedChars.includes(inputValue)) { alert("Пожалуйста, введите одну из допустимых букв: Е, Н, Б, О, З для поля " + "{{ line.name }}"); inputField.focus(); isValid = false; return false; // Останавливаем отправку формы } {% endfor %} return isValid; // Разрешаем отправку формы, если все поля валидны } </script> </head> <body> <a href="/">Visit Checker</a> <h2>Пожалуйста выберите нужное действие! </h2> <h3>Дававйте проверим! Е-Есть, Н-неявка, Б-болеет, О-отгул, З-задержался</h3> <form method="POST" action="/action_process" onsubmit="return validateForm()"> {% for line in lines %} <p>{{ line.name }}: <input type="text" name="status_{{ loop.index0 }}" maxlength="1" required> </p> {% endfor %} <button type="submit">Сохранить</button> </form> </body> </html>