Skip to content

Commit

Permalink
Fix age validation
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminJohnson2204 committed Feb 24, 2024
1 parent 8cfaa05 commit f3c8d35
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/src/app/vsr/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,13 @@ const VeteranServiceRequest: React.FC = () => {
label="Age"
variant="outlined"
placeholder="Enter your age"
{...register("age", { required: "Age is required" })}
{...register("age", {
required: "Age is required",
min: {
value: 0,
message: "This field must be positive",
},
})}
required
error={!!errors.age}
helperText={errors.age?.message}
Expand Down

0 comments on commit f3c8d35

Please sign in to comment.