I have a form where I want to edit some user data. Thus, already saved data is placed as th: value and after submitting I check with spring validation and want to return the form on the wrong input. I want the input field to have a user input value, but it always gives me the saved input.
What the input field looks like
<input type="text" th:value="${product.name}" th:field="*{name}" th:errorclass="fieldError"/>
If the form is loaded the first time you enter the input fields, the values ββof already saved data.
If it is loaded after sending and with a validation error, the input fields must have a user input value.
Is there any way to do this?
Thanks!
source share