Why my sign up box is disappear after click on sign up (Click on sign up and then click on the sign up button to watch)

If you fill the login box and click on login button, then it will show you a check mark if your inputs are correct and it will show you a exclamation circle with error message. But when you click on sign up, fill the 2nd box and then click on sihn up button.... It will show nothing... It will neither show you a check for up your correct input nor show a exclamation circle with message for your wrong/ invalid input... Even the box is disappear after clicking on sign up button. I could not find the error of this code.... Please help me to fix this error.. even I couldn't understand what is the error 🤔 https://code.sololearn.com/WNqX8C7tU5Qy/?ref=app

19th Oct 2022, 7:08 AM
Pooja Sahoo
Pooja Sahoo - avatar
2 Answers
+ 2
Both forms have same id="form". ids should be unique and the getElemtById resturns only one, so u add eventListener to login submit button. I may sound like a hater 🥺but your code is a bit messy with the inline CSS, JS, also the center tag which is deprecated and align property in the html. You should try to refactor your code it will be easier for developers and obviously you to debug. 👍
19th Oct 2022, 9:19 AM
Arturop - avatar
+ 1
Thank You very very much 😇 You save my valuable time ... Thanks for spending your priceless time to debug my code. You are correct my code is so messy but I'm a beginner javascript learner ... I don't know how to write less code and how to properly arrange them.. that's why I lost my most of the time to debug my code... I spend my 3+ days to only made this login/sign up box. If you didn't help me on this error then I might lost my upcoming days too to solve this error .... Thanks a lot for your help. 🙏😇
19th Oct 2022, 3:30 PM
Pooja Sahoo
Pooja Sahoo - avatar