Skip to content

Commit

Permalink
Merge pull request #67 from heyyakash/new
Browse files Browse the repository at this point in the history
added error messages
  • Loading branch information
heyyakash authored Nov 26, 2023
2 parents a005482 + d71d12a commit fe08d44
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion src/components/sections/Cta.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const Cta = ({
</svg>
</Input>*/}

<a href={'https://fest.pointblank.club/'}>
<a href={'/form'}>
<button
style={{
display: 'flex',
Expand Down

0 comments on commit fe08d44

Please sign in to comment.