RaidEyes• 390
@RaidEyes
Posted
Hi there, I guess this is your first project here right? Well done! However, I find that there are some minor mistakes you need to consider:
- Your email
<input>
doesn't have a validation. Which means that the user can type whatever they want in the input and theform
can still be submitted. Here you should use JS(yourInput).validity.valid
to check if the user is typing correctly, the output of this istrue
orfalse
:
- If the validation is true =>
errorMessage.innerHTML = ""
- If the validation is false =>
errorMessage.innerHTML = "Invalid email address"
- The complete message doesn't show the user's email, it only shows the default input of your HTML, try get the user input with
innerHTML
.
Happy coding!
0