Need help with validity script

im really stuck on this form validation so far i was only able to get it to check for the email or password but not if there both blank all i got is

function blankfields(){
if(screenname.hiddeninput.length == 0){
alert(“document.screenname.hiddeninput”)
screenname.hiddeninput.select();
screenname.hiddeninput.focus();
return false;

}

}
any help will be appreciated

Start off by assigning isValid to true at the start of the function.
Then perform your tests, changing isValid to false if it doesn’t pass your test.
Finally return isValid.