Validate input fields with a bit of JavaScript code

'Some forms have two email input fields. The content of both fields must be equal before the form can be submitted. I searched for a good solution for a long time but couldn’t find one. Of course, I could have used a third-party solution, like Jotform, but I didn’t want to.
So I decided to work on it myself and used OpenAI to write JavaScript code that does exactly that. It compares two input fields and only sends the form if their contents are equal.
My solution uses the Parsley.js library. I tried many other things, but only this really worked.
If you want to see how I did this with just a bit of JavaScript, check out my YouTube video on this topic. Enjoy