mirror of
https://github.com/dyzulk/dyzulk-apps.git
synced 2026-01-26 13:22:02 +07:00
update 0.0.1
This commit is contained in:
@@ -13,9 +13,88 @@
|
||||
<h4 class="mb-4 font-semibold text-gray-800 dark:text-gray-300">
|
||||
Update your Password
|
||||
</h4>
|
||||
<form action="<?=base_url('account/updatePassword');?>" method="post">
|
||||
<label class="block text-sm">
|
||||
<span class="text-gray-700 dark:text-gray-400">
|
||||
Type your current password
|
||||
</span>
|
||||
<input
|
||||
id="current-password"
|
||||
name="password"
|
||||
class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input"
|
||||
type="password" />
|
||||
</label>
|
||||
|
||||
<!-- Type your new password -->
|
||||
<label class="block mt-4 text-sm">
|
||||
<span class="text-gray-700 dark:text-gray-400">
|
||||
Type your new password
|
||||
</span>
|
||||
<input
|
||||
id="new-password"
|
||||
name="password1"
|
||||
class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input"
|
||||
type="password" />
|
||||
<span id="new-password-message" class="text-xs text-gray-600 dark:text-gray-400"></span>
|
||||
</label>
|
||||
|
||||
<!-- Type your new password again -->
|
||||
<label class="block mt-4 text-sm">
|
||||
<span class="text-gray-700 dark:text-gray-400">
|
||||
Type your new password again
|
||||
</span>
|
||||
<input
|
||||
id="confirm-password"
|
||||
name="password2"
|
||||
class="block w-full mt-1 text-sm dark:text-gray-300 dark:border-gray-600 dark:bg-gray-700 focus:border-purple-400 focus:outline-none focus:shadow-outline-purple dark:focus:shadow-outline-gray form-input"
|
||||
type="password" />
|
||||
<span id="confirm-password-message" class="text-xs text-gray-600 dark:text-gray-400"></span>
|
||||
</label>
|
||||
<div class="mb-4 mt-6">
|
||||
<button
|
||||
type="submit"
|
||||
class="px-4 py-2 text-sm font-medium leading-5 text-white transition-colors duration-150 bg-purple-600 border border-transparent rounded-lg active:bg-purple-600 hover:bg-purple-700 focus:outline-none focus:shadow-outline-purple"
|
||||
>
|
||||
Save Changes
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
const newPasswordInput = document.getElementById("new-password");
|
||||
const confirmPasswordInput = document.getElementById("confirm-password");
|
||||
const newPasswordMessage = document.getElementById("new-password-message");
|
||||
const confirmPasswordMessage = document.getElementById("confirm-password-message");
|
||||
|
||||
newPasswordInput.addEventListener("input", () => {
|
||||
const newPassword = newPasswordInput.value;
|
||||
if (newPassword.length <= 3) {
|
||||
newPasswordMessage.textContent = "Your password must be at least 3 characters long.";
|
||||
newPasswordMessage.style.color = "#dc2626";
|
||||
} else if (newPassword.length > 3 && newPassword.length < 6) {
|
||||
newPasswordMessage.textContent = "Your password is too short.";
|
||||
newPasswordMessage.style.color = "orange";
|
||||
} else if (newPassword.length >= 6) {
|
||||
newPasswordMessage.textContent = "Your password is strong.";
|
||||
newPasswordMessage.style.color = "#16a34a";
|
||||
}
|
||||
});
|
||||
|
||||
confirmPasswordInput.addEventListener("input", () => {
|
||||
const newPassword = newPasswordInput.value;
|
||||
const confirmPassword = confirmPasswordInput.value;
|
||||
|
||||
if (confirmPassword !== newPassword) {
|
||||
confirmPasswordMessage.textContent = "Passwords do not match.";
|
||||
confirmPasswordMessage.style.color = "#dc2626";
|
||||
} else {
|
||||
confirmPasswordMessage.textContent = "Password match";
|
||||
confirmPasswordMessage.style.color = "#16a34a";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user