-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
data fetching with the delay message & Feature Validate AddBooking #53
base: main
Are you sure you want to change the base?
data fetching with the delay message & Feature Validate AddBooking #53
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done. I have requested some changes.
const [error, setError] = useState(null); | ||
|
||
// Function to check the email format | ||
const isValidEmail = (email) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why didn't you use the pattern attribute to add validation on email input indead of creating a new funtion? Like here https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email
alert("Please fill in all required fields."); | ||
|
||
// Validation for first name, last name, email, and room ID | ||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. Input element have attribute required
to validate that input id filled or not.
look into this https://www.w3schools.com/js/js_validation.asp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That because it's only works on the HTML on react I'm trying to check if any of the fields are empty, that's what I understood when I was testing the validation function. It would make an extra line if I added the required attribute on the input fields
@@ -1,97 +1,97 @@ | |||
// Bookings.scss | |||
|
|||
.bookings { | |||
padding: 20px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The styles looks good.
I did not know that input validation is another feature called validate AddBookings. so this PR is for two features. and I did a stretch validation to check if the room is booked