diff options
| author | realtradam <[email protected]> | 2024-07-11 21:08:42 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2024-07-11 21:08:42 -0400 |
| commit | 40075162def7d0a4ce9d795f4cfe83264fac50b4 (patch) | |
| tree | 9048db522f46519ab19554434606897f974db488 /src/main/resources/templates/articles/new.html | |
| parent | 86cb044572b9e07d4b63871b9a3f4b384bed4caa (diff) | |
| download | spring-blog-40075162def7d0a4ce9d795f4cfe83264fac50b4.tar.gz spring-blog-40075162def7d0a4ce9d795f4cfe83264fac50b4.zip | |
validate new and edited article fields
Diffstat (limited to 'src/main/resources/templates/articles/new.html')
| -rw-r--r-- | src/main/resources/templates/articles/new.html | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/resources/templates/articles/new.html b/src/main/resources/templates/articles/new.html index afaed02..f5924d6 100644 --- a/src/main/resources/templates/articles/new.html +++ b/src/main/resources/templates/articles/new.html @@ -20,7 +20,7 @@ name="title" th:field="*{title}" placeholder="Yep"> - <p class="text-red-500 text-xs italic">Please fill out this field.</p> + <p th:if="${#fields.hasErrors('title')}" th:errors="*{title}" class="text-red-500 text-xs italic">Please fill out this field.</p> </div> <div class="w-full md:w-1/2 px-3"> <label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" @@ -33,6 +33,7 @@ name="photoUrl" th:field="*{photoUrl}" placeholder="Doe"> + <p th:if="${#fields.hasErrors('photoUrl')}" th:errors="*{photoUrl}" class="text-red-500 text-xs italic">Please fill out this field.</p> </div> </div> <div class="flex flex-wrap -mx-3 mb-6"> @@ -47,6 +48,7 @@ name="content" th:field="*{content}" placeholder="Doe"> + <p th:if="${#fields.hasErrors('content')}" th:errors="*{content}" class="text-red-500 text-xs italic">Please fill out this field.</p> </div> </div> <div class="flex flex-wrap mb-2"> |
