@cacosted
Posted
Hi @aminetakdenti congrats on your solution, looks great.
Testing the form I noticed that, when you send it with errors and then you solve the errors there is no visual feedback, the error state remains, would be a good improvement to remove the error state when the form is OK.
I saw your javaScript
and It looks very clean and compact. Something that I would recommend is to turn querySelector('div > input')
into querySelector('input')
is simpler and it does the same thing.
Also, I think you should try using the FormData
object this is very handy when working with form and different inputs.
⭐️ Here is a cool trick you can do with this:
const form = document.querySelector('form')
// 👇Here you get an object where the keys are the input name, and the value is the input's value.
const formData = Object.fromEntries(new FormData(form))
Marked as helpful