function validate() { if(document.frm1.username.value=="") { alert("Please fill up the username"); document.frm1.username.focus(); return false; } if(document.frm1.password.value=="") { alert("Please fill up the password"); document.frm1.password.focus(); return false; } return true; } Login Form Username:- Password:- Register on studiotraffic