Created
December 13, 2025 17:38
-
-
Save davidystephenson/34c6289bbbf3d3b4cca52c2f8f48c3ae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| console.log('user registration') | |
| const form = document.getElementById('registerForm') | |
| console.log('form', form) | |
| form.addEventListener('submit', (event) => { | |
| event.preventDefault() | |
| const fullname = document.getElementById('fullname') | |
| const username = document.getElementById('username') | |
| const email = document.getElementById('email') | |
| const contact = document.getElementById('contact') | |
| const password = document.getElementById('pswd') | |
| console.log('password', password) | |
| const confirmPassword = document.getElementById('confirm-password') | |
| console.log('confirmPassword', confirmPassword) | |
| if (password.value !== confirmPassword.value) { | |
| alert('Passwords do not match') | |
| return | |
| } | |
| const user = { | |
| fullname: fullname.value, | |
| username: username.value, | |
| email: email.value, | |
| contact: contact.value, | |
| password: password.value | |
| } | |
| const userJson = JSON.stringify(user) | |
| localStorage.setItem('user', userJson) | |
| window.location.href = './sign-in.html' | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment