The code displays a pop-up alert message if the username is less than 6 characters and submits the form. What change should be made to prevent the form from submitted if the username is less than 6 characters?
Hmm, interesting. I was thinking that we could just change the function call on line 13 to validateForm(), but Option B seems like the more elegant solution. Gotta love those JavaScript tricks!
Ah, I see what the problem is! The form is submitting even when the username is less than 6 characters. Clearly, we need to add a return false; after the alert call to prevent the form from submitting. Option B is the way to go here.
Lorrie
3 days agoTimothy
5 days agoLavonna
6 days agoJuliann
7 days agoLorrie
9 days ago