Try this,
<input type="submit" value="Submit" onclick="return validate();" />
<script type="text/javascript">
function validate()
{
var name=document.getElementById("Username");
if(name.value=="")
{
alert("Please enter username");
name.focus();
return false;
}
var Password=document.getElementById("Password");
if(Password.value=="")
{
alert("Please enter Password");
Password.focus();
return false;
}
var rePassword=document.getElementById("Confirm Password");
if(rePassword.value=="")
{
alert("Please re-enter Password");
rePassword.focus();
return false;
}
var dob=document.getElementById("Date of Birth");
if(dob.value=="")
{
alert("Please re-enter Password");
dob.focus();
return false;
}
var email=document.getElementById("Email Address");
if(email.value=="")
{
alert("Please re-enter Password");
email.focus();
return false;
}
var cemail=document.getElementById("Confirm Email");
if(cemail.value=="")
{
alert("Please re-enter Password");
cemail.focus();
return false;
}
var address=document.getElementById("Address Line 1");
if(address.value=="")
{
alert("Please re-enter Password");
address.focus();
return false;
}
var city=document.getElementById("Town or City");
if(city.value=="")
{
alert("Please re-enter Password");
city.focus();
return false;
}
var pin=document.getElementById("Post Code");
if(pin.value=="")
{
alert("Please re-enter Password");
pin.focus();
return false;
}
}
</script>
This is the simple validation. If you want detail validation means, you need to check detailly, like email format,only alphabets etc.,
Thanks.