Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/formular/formular.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ input::placeholder {
font-style: italic;
}

label {
display: block;
margin-bottom: 5px;
font-weight: bold;
color: #333;
text-align: left;
margin-left: auto;
margin-right: auto;
max-width: 350px;
}

/* Submit button */
button {
width: 100%;
Expand Down
34 changes: 25 additions & 9 deletions src/formular/formular.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,40 @@
<h1>BMI Formular</h1>

<form id="bmiForm">
<input type="number" id="age" name="Age" placeholder="Age (Years)" required min="1" max="120" />
<input type="date" id="date" name="date" placeholder="Birthday" required />
<input type="number" id="weight" name="weight" placeholder="Weight in Kg" required min="1" max="500" />
<input type="number" id="height" name="height" placeholder="Height in cm" required min="50" max="250" />

<button type="button" onclick="calculateBMI()">BMI berechnen</button>
<button type="button" onclick="clearData()" style="margin-top: 10px; background-color: #f44336;">
<label for="age">Alter (Jahre):</label>
<input type="number" id="age" name="Age" placeholder="z.B. 25" required min="1" max="120"
aria-describedby="ageHelp" />
<small id="ageHelp" style="display:block; color:#666; margin-bottom:10px;">
Bitte geben Sie Ihr Alter zwischen 1 und 120 ein.
</small>

<label for="date">Geburtsdatum:</label>
<input type="date" id="date" name="date" required />

<label for="weight">Gewicht (kg):</label>
<input type="number" id="weight" name="weight" placeholder="z.B. 75" required min="1" max="500" />

<label for="height">Größe (cm):</label>
<input type="number" id="height" name="height" placeholder="z.B. 175" required min="50" max="250" />

<button type="button" onclick="calculateBMI()" aria-label="BMI berechnen">
BMI berechnen
</button>

<button type="button" onclick="clearData()" style="margin-top: 10px; background-color: #f44336;"
aria-label="Alle Eingaben löschen">
Clear/Reset
</button>
</form>

<div id="result" style="display: none;">
<div id="error" role="alert" aria-live="polite"></div>

<div id="result" style="display: none;" role="region" aria-label="BMI Ergebnis">
<h2>Ihr BMI Ergebnis</h2>
<p id="bmiValue"></p>
<p id="bmiCategory"></p>
</div>

<div id="error"></div>
</body>

</html>