function validate()
{
var a=documents.forms["yourformname"]["yourpasswordfieldname"].value;
var b=documents.forms["yourformname"]["yourconfirmpasswordfieldname"].value;
if(!(a==b))
{
alert("both passwords are not matching");
return false;
}
return true;
}