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