Declare your form tag with 'onsubmit' attribute as below
<form name="loginform" id="loginform1" action="unsaved:///?page_id=7&instance=1" method="post" onsubmit="return validate()">
for a particular element, say input box for User name you can validate inside validate() function of javascript as below
function validate()
{
var username=document.getElementById("user_login1").val();
if(username == "")
{
alert("User name can't be left blank!");
return false;
}
}
Likewise you can validate other members of form as per your validation requirements.Hope this will help you.