Reputation: 193
I have a problem as mentioned in the title.
The input field is of type number.
The th:field refers to an int attribute in the database.
I want my placeholder to be visible instead of the default 0 value.
<input id="courseCredits" name="courseCredits" th:field="*{courseCredits}" class="form-control" placeholder="Course Credits" type="number" min="0" required autofocus/>
Upvotes: 3
Views: 1430
Reputation: 20487
If you don't want the default of 0 you can't use an int
. Instead use an Integer
with null
for empty.
Upvotes: 2