function checkPasswords() {
    const password1 = document.getElementById("password").value;
    const password2 = document.getElementById("rpassword").value;

    if (password1 !== password2) {
        document.getElementById("error-msg").innerHTML = "Passwords do not match.";
        document.getElementById("btn_sub").disabled = true;

    } else {
        document.getElementById("error-msg").innerHTML = "";
        document.getElementById("btn_sub").disabled = false;

    }

}