Viewing File: /home/assersoft/public_html/doctor-assistant/app/Views/reset_password_form.php

<!-- reset_password_form.php -->

<form action="<?= base_url("user/reset-password/" . esc($token)) ?>" method="post" id="resetPasswordForm">
    <div>
        <label for="password">New Password</label>
        <input type="password" id="password" name="password" required />
        <label for="confirm_password">Confirm New Password</label>
        <input type="password" id="confirm_password" name="confirm_password" required />
    </div>
    <button type="submit">Reset Password</button>
</form>

<script>
    document.getElementById('resetPasswordForm').addEventListener('submit', function(e) {
        const password = document.getElementById('password').value;
        const confirmPassword = document.getElementById('confirm_password').value;

        if (password !== confirmPassword) {
            e.preventDefault(); // Prevent form submission
            alert('Passwords do not match.');
        }
    });
</script>
Back to Directory File Manager