Formvalidation is not working.what's wrong in my code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Formvalidation is not working.what's wrong in my code

https://code.sololearn.com/Wkwj4nTpUY5e/?ref=app

23rd Mar 2023, 2:24 PM
Susheela
Susheela - avatar
2 Answers
+ 1
Add event parameter to your function call and definition then prevent the default behavior of submission onsubmit="formvalidation(event)" formvalidation(event){ event.preventDefault(); }
24th Mar 2023, 6:18 AM
Jason Edelson
Jason Edelson - avatar
+ 1
Your input type says 'username' it should say 'text'
24th Mar 2023, 7:58 PM
William Mabotja
William Mabotja - avatar