Hi Njoku! Great article. I was wondering if you knew how to make sure that the email is NOT sent if the fields are empty. I have tried creating my own validations but the email will still send with empty input fields. Thanks in advance!
I am a Software Engineer and Developer Advocate who loves sharing knowledge via writing, videos, mentorship, and working out. Please Subscribe: https://www.youtube.com/channel/UCcz5Bvr4kGHPFAjvnRhIQ4g
Hi Njoku! Great article. I was wondering if you knew how to make sure that the email is NOT sent if the fields are empty. I have tried creating my own validations but the email will still send with empty input fields. Thanks in advance!
You can disable or even hide the submit button if any field is empty.
You may also do a check while trying to submit and throw an error that terminates the submission if any field is empty.
Why you're not using 'required' in input element? If you use 'required' in each input element, you can't click 'send' button.