Y‘still need to get the order right. You have your form elements below the code that looks for form elements.
Looking in the F12 console should be your first move, that’ll show that exact error.
Thank you for persevering and helping us through this.