
Contact form using tailwind and react
Design comparison
Solution retrospective
Happy to have completed in short period of time, It was fun to do the project.
What challenges did you encounter, and how did you overcome them?I had problem uploading it to the github due to minor error. I did some research and found the solution.
What specific areas of your project would you like help with?My checkbox is not clickable, it can be clicked if we press the consent area. I need help with that one.
Community feedback
- P@CarlHummPosted 4 days ago
Hey there
I may be wrong but it looks like the img element is sitting above the hidden input so the event listener isn't getting fired other than via the linked label. When you change the z-index in the browser dev tools you can click both the checkbox and label.
Update: Contain input fields inside a form and use single onChange
Just some extra advice. The consent checkbox, submit button and input fields in most situations should be contained within a
<form>
element and inside the<main>
. As you have already wrote some great logic to decipher each input type inhandleChange
, you can nest the input fields and buttons within a form element and place a single eventListener on the form element itself, like<form onChange={handleChange}>
this should work fine due to eventBubbling and the use of target instead of currentTarget.Good luck on implementing the fix, and on your future projects
Marked as helpful1 - @CleshyPosted 4 days ago
Hi! 👋
May I ask why the
img
element is necessary within theCheckbox
? Is it part of the task description, or did you try to solve something this way?I haven't started this project yet, but I’m happy to help if I can. 💓
1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord