+ 1

Anytime i press the "Confirmer" button, i get "ReferenceError: choixforms is not defined" in the console

link to the code : https://code.sololearn.com/WBXTEW1H61sV

11th May 2021, 6:41 PM
Sam P.
Sam P. - avatar
1 Respuesta
+ 3
Move your event binding to JavaScript. You have onclick="choixforms()" in HTML. It would be better for you to set id="confirmer" and write JavaScript like: document.addEventListener('DOMContentLoaded', function() { document.getElementById('confirmer').addEventListener('click', choixforms); }); It would be easier to troubleshoot your code if it was indented consistently too. You should test as you write code. It might seem like lots of effort or time to do this but it may be shorter overall if you just rewrote your page while testing with each little change. If you just copy/pasted this code from elsewhere, you'll likely get slowed down too more trying to solve too many bugs at once. Keep a backup of what you have now but just add one button, run and test, get it working as you expect, then repeat until you have everything you want. This way if you get stuck, you'll have only 1 small bug to deal with at any given time and you'll know where it is.
11th May 2021, 11:37 PM
Josh Greig
Josh Greig - avatar