-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from CMP26Projects/validations
Validations
- Loading branch information
Showing
6 changed files
with
46 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,9 @@ export default function LogIn() { | |
name="email" | ||
value={email} | ||
placeholder="[email protected]" | ||
onChange={(e) => setEmail(e.target.value)} | ||
onChange={(e) => {setEmail(e.target.value); e.target.setCustomValidity('');}} | ||
pattern="^[a-zA-Z0-9._%\+\-]+@[a-zA-Z0-9._%\+\-]+\.[a-z]{2,}$" | ||
onInvalid={(e) => e.target.setCustomValidity('الرجاء إدخال بريد إليكتروني صحيح')} | ||
required={true} | ||
/> | ||
<TextInput | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,7 +80,9 @@ export default function SignUp() { | |
name="firstName" | ||
value={firstName} | ||
placeholder="أكتب أسمك الاول" | ||
onChange={(e) => setFirstName(e.target.value)} | ||
onChange={(e) => {setFirstName(e.target.value); e.target.setCustomValidity('');}} | ||
pattern="^[\u0621-\u064Aa-zA-Z]+$" | ||
onInvalid={(e) => e.target.setCustomValidity('الرجاء إدخال الاسم الاول فقط (باللغة العربية او الانجليزية)')} | ||
required={true} | ||
/> | ||
<TextInput | ||
|
@@ -89,7 +91,9 @@ export default function SignUp() { | |
name="middleName" | ||
value={middleName} | ||
placeholder="أكتب أسمك المتوسط" | ||
onChange={(e) => setMiddleName(e.target.value)} | ||
onChange={(e) => {setMiddleName(e.target.value); e.target.setCustomValidity('');}} | ||
pattern="^[\u0621-\u064Aa-zA-Z]+$" | ||
onInvalid={(e) => e.target.setCustomValidity('الرجاء إدخال الاسم الاوسط فقط (باللغة العربية او الانجليزية)')} | ||
required={true} | ||
/> | ||
<TextInput | ||
|
@@ -98,7 +102,9 @@ export default function SignUp() { | |
name="lastName" | ||
value={lastName} | ||
placeholder="أكتب أسمك الأخير" | ||
onChange={(e) => setLastName(e.target.value)} | ||
onChange={(e) => {setLastName(e.target.value); e.target.setCustomValidity('');}} | ||
pattern="^[\u0621-\u064Aa-zA-Z]+$" | ||
onInvalid={(e) => e.target.setCustomValidity('الرجاء إدخال الاسم الأخير فقط (باللغة العربية او الانجليزية)')} | ||
required={true} | ||
/> | ||
</div> | ||
|
@@ -110,7 +116,9 @@ export default function SignUp() { | |
name="email" | ||
value={email} | ||
placeholder="[email protected]" | ||
onChange={(e) => setEmail(e.target.value)} | ||
onChange={(e) => {setEmail(e.target.value); e.target.setCustomValidity('');}} | ||
pattern="^[a-zA-Z0-9._%\+\-]+@[a-zA-Z0-9._%\+\-]+\.[a-z]{2,}$" | ||
onInvalid={(e) => e.target.setCustomValidity('الرجاء إدخال بريد إليكتروني صحيح')} | ||
required={true} | ||
/> | ||
<TextInput | ||
|
@@ -140,7 +148,9 @@ export default function SignUp() { | |
name="phone" | ||
value={phone} | ||
placeholder="أكتب رقم هاتفك" | ||
onChange={(e) => setPhone(e.target.value)} | ||
onChange={(e) => {setPhone(e.target.value); e.target.setCustomValidity('');}} | ||
pattern="^01[0-9]{9}$" | ||
onInvalid={(e) => e.target.setCustomValidity('الرجاء إدخال رقم هاتف صحيح')} | ||
required={true} | ||
/> | ||
<RadioInput | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters