`document.getElementById(“submit”).addEventListener(“click”,function checkpwd(){ var password=document.getElementById(‘password’).value; if(password.length<8) { alert(“Your password must be at least 8 characters”);
@NachfolgerOct 14.2020 — #The context you have provided thus far will not suffice. You're already "validating" the password here, are you trying to prevent the submit event from processing?
``Javascript<i> </i>document.getElementById("submit").addEventListener("click", function(e) { if (document.getElementById('password').value.length < 8) { alert("Your password must be at least 8 characters"); e.preventDefault(); } });<i> </i>`</CODE>
@VITSUSAOct 15.2020 — #@Mohanprasath#1624209 I agree with Nachfolger, you're already "validating" the password here, are you trying to prevent the submit event from processing?