Skip to content

Commit

Permalink
Show error upon validation failure
Browse files Browse the repository at this point in the history
On the front end, prompt the user if input left blank.

On the back end, display error message when validation requirement is
not met.
  • Loading branch information
sacren committed Dec 12, 2024
1 parent 5983e15 commit 8499905
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions resources/views/jobs/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@
id="title"
class="block w-full rounded-md shadow-sm ring-1 ring-gray-300 focus:ring-indigo-600 focus:border-indigo-600 sm:max-w-md sm:text-sm"
placeholder="e.g., Petroleum Technician"
required
/>
</div>

@error('title')
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
@enderror
</div>

<div class="sm:col-span-4">
Expand All @@ -37,8 +42,13 @@ class="block w-full rounded-md shadow-sm ring-1 ring-gray-300 focus:ring-indigo-
id="salary"
class="block w-full rounded-md shadow-sm ring-1 ring-gray-300 focus:ring-indigo-600 focus:border-indigo-600 sm:max-w-md sm:text-sm"
placeholder="e.g., $187,000.00"
required
/>
</div>

@error('salary')
<p class="mt-2 text-sm text-red-600">{{ $message }}</p>
@enderror
</div>
</div>

Expand Down

0 comments on commit 8499905

Please sign in to comment.