added javascript function to check password.