Skip to content

Commit

Permalink
error messages added
Browse files Browse the repository at this point in the history
  • Loading branch information
heyyakash committed Nov 26, 2023
1 parent 82207a1 commit bb19403
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/Form/Form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ const Form = () => {
const { register, handleSubmit,reset } = useForm()

const onSubmit = async (dataa) => {
const {usn,whatsapp} = dataa
const {usn,whatsapp,branch, year} = dataa
if(branch === "Select Branch") {
toast.error("Enter Your Branch",{duration:2500})
return
}
if(year === "Select year") {
toast.error("Enter Your Year",{duration:2500})
return
}
if(!phoneRegex.test(whatsapp)){
toast.error("Please enter a valid 10 digit phone no.",{duration:3000})
return
Expand Down

0 comments on commit bb19403

Please sign in to comment.