This commit is contained in:
2025-02-05 15:50:04 +05:30
parent 7f15dbfc08
commit 55448e34c6
38 changed files with 449 additions and 663 deletions

View File

@@ -1,10 +1,7 @@
// script.js
// Add any form validation or interactivity here, like checking if the fields are filled
document.querySelector("form").addEventListener("submit", function(event) {
const inputs = document.querySelectorAll(".input-field");
let valid = true;
inputs.forEach(input => {
if (input.value === "") {
valid = false;
@@ -15,39 +12,29 @@ document.querySelector("form").addEventListener("submit", function(event) {
});
if (!valid) {
event.preventDefault(); // Prevent form submission if validation fails
event.preventDefault();
alert("Please fill all the fields.");
}
});
document.getElementById('toggle-password').addEventListener('click', function () {
document.getElementById('toggle-password').addEventListener('click', function() {
const passwordField = document.getElementById('password-field');
const passwordType = passwordField.getAttribute('type') === 'password' ? 'text' : 'password';
passwordField.setAttribute('type', passwordType);
// Optionally, you can change the eye icon to an "eye-off" icon when the password is visible
this.src = passwordType === 'password' ? 'assets/images/eye.svg' : 'assets/images/eye-off.svg';
});
// // Array of background image sources
// const images = ['assets/images/dna.jpg', 'assets/images/dna2.jpg','assets/images/dna3.jpg','assets/images/dna4.jpg'];
// let currentIndex = 0;
function toggleSubmitButton() {
const checkbox = document.getElementById("agree");
const submitBtn = document.getElementById("submit-btn");
const errorMessage = document.getElementById("error-message");
// function changeBackgroundImage() {
// const imgElement = document.getElementById('background-image');
// // Fade out
// imgElement.style.opacity = 0;
if (checkbox.checked) {
submitBtn.disabled = false;
errorMessage.style.display = "none";
} else {
submitBtn.disabled = true;
}
}
// setTimeout(() => {
// // Change image source
// currentIndex = (currentIndex + 1) % images.length;
// imgElement.src = images[currentIndex];
// // Fade in
// imgElement.style.opacity = 1;
// }, 800); // Match this timeout with the CSS transition duration
// }
// // Change image every 5 seconds
// setInterval(changeBackgroundImage, 5000);
document.addEventListener("DOMContentLoaded", toggleSubmitButton);