Commit e7c6af42 by Patryk Czarnik

kalkulator: zaznaczanie operacji ©Piotr :)

parent a73f2bff
......@@ -26,6 +26,7 @@ public class KalkulatorController {
};
model.addAttribute("wynik", wynik);
model.addAttribute("operacja", operacja);
return "kalkulator.html";
}
......
......@@ -11,11 +11,11 @@
<form method="post">
<p>Wprowadź liczby i wybierz działanie</p>
<input type="number" name="liczba1" id="liczba1" th:value="${param.liczba1}">
<select name="operacja">
<option value="+">+</option>
<option value="-">-</option>
<option value="*">*</option>
<option value="/">/</option>
<select id="operacja" name="operacja">
<option value="+" th:selected="${operacja == '+'}">+</option>
<option value="-" th:selected="${operacja == '-'}">-</option>
<option value="*" th:selected="${operacja == '*'}">*</option>
<option value="/" th:selected="${operacja == '/'}">/</option>
</select>
<input type="number" name="liczba2" id="liczba2" th:value="${param.liczba2}">
<button>Oblicz</button>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment