Skip to content

Commit

Permalink
Merge pull request #82 from kamini08/main
Browse files Browse the repository at this point in the history
  • Loading branch information
SkySingh04 authored Sep 23, 2024
2 parents 6308e82 + a1e9c8a commit 40c31a7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/(default)/recruitment/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const RegisterPage = () => {
}
});
});

// useEffect(() => {
// router.push("/");
// })
Expand Down
17 changes: 14 additions & 3 deletions components/forms/pbctfForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,17 +290,28 @@ const PBCTFForm: React.FC = () => {
<div>
<input
{...register(`participant${participantNumber}.usn` as const, {
required: "USN required",
required: participantNumber === 1 && watchYear1 === "1"
|| participantNumber === 2 && watchYear2 === "1"
? "Admission Number required"
: "USN required",
pattern: {
value:
(participantNumber === 1 && watchYear1 === "1") ||
(participantNumber === 2 && watchYear2 === "1")
? /^[1-9][0-9][A-Z]{4}[0-9]{4}$/
: /^1DS[1-3][0-9][A-Z]{2}[0-9]{3}$/,
message: "Invalid USN",
message: participantNumber === 1 && watchYear1 === "1"
|| participantNumber === 2 && watchYear2 === "1"
? "Invalid Admission Number"
: "Invalid USN",
},
})}
placeholder="USN"
placeholder={
(participantNumber === 1 && watchYear1 === "1") ||
(participantNumber === 2 && watchYear2 === "1")
? "Admission Number"
: "USN"
}
className="w-full px-4 py-2 border rounded-md bg-transparent form-input focus:border-0 focus:outline-offset-0 focus:outline-green-500"
/>
{errors[`participant${participantNumber}`]?.usn && (
Expand Down

0 comments on commit 40c31a7

Please sign in to comment.