forms styling WIP

This commit is contained in:
2025-06-23 11:37:52 +02:00
parent 837e666af9
commit 8dd24a8c1e
5 changed files with 83 additions and 62 deletions

View File

@@ -5,26 +5,34 @@ include dirname(__DIR__).'/header.phtml';
<h2>Neuer Kurs</h2>
<form method="post">
<form method="post" class="form-grid">
<?php foreach ($labels as $index => $value) {
echo '<label for="' . $index . '">' . $value . '</label>';
if ($index == "beschreibung") {
echo "<textarea id=\"$index\" name=\"$index\" >";
if (isset($validData[$index])) { echo $validData[$index]; }
<?php
$index = 0;
foreach ($labels as $key => $value) {
if ($key == "beschreibung") {
if($index % 2 != 0) echo '<div></div>';
}
echo '<div class="input"><label for="' . $key . '">' . $value . '</label>';
if ($key == "beschreibung") {
if($index % 2 != 0) echo '<div></div>';
echo "<textarea id=\"$key\" name=\"$key\" >";
if (isset($validData[$key])) { echo $validData[$key]; }
echo "</textarea><br>";
} else {
echo '<input type="text" name="' . $index . '" value="' . (isset($validData[$index]) ? $validData[$index] : '') . '"><br>';
echo '<input class="input" type="text" name="' . $key . '" value="' . (isset($validData[$key]) ? $validData[$key] : '') . '"><br>';
}
if (isset($errors[$index])) {
echo '<label class="errorMsg">' . $errors[$index] . '</label><br>';
if (isset($errors[$key])) {
echo '<label class="errorMsg">' . $errors[$key] . '</label><br>';
}
echo '</div>';
$index++;
}
?>
<input type="hidden" name="controller" value="contact">
<input type="hidden" name="do" value="validateForm">
<input type="hidden" name="controller" value="admin">
<input type="hidden" name="do" value="showForm">
<input type="submit" name="submit" value="Absenden"></form>
<?php include dirname(__DIR__).'/footer.phtml'; ?>