fix: registration
Fix a couple typos in registration JS
This commit is contained in:
		| @@ -1,8 +1,7 @@ | ||||
| // Get references to the form elements | ||||
| const nameInput = document.getElementById("name"); | ||||
| const emailInput = document.getElementById("emailAddress"); | ||||
| const passwordInput = document.getElementById("password"); | ||||
| const confirmPasswordInput = document.getElementById("confirmPassword"); | ||||
| const nameInput = document.getElementById("registration_form_name"); | ||||
| const emailInput = document.getElementById("registration_form_email"); | ||||
| const passwordInput = document.getElementById("registration_form_plainPassword"); | ||||
| const csrfToken = document.getElementById("registration_form__token").value; | ||||
|  | ||||
| // Add event listeners to the form | ||||
| @@ -18,25 +17,18 @@ function handleSubmit(event) { | ||||
|     const name = nameInput.value; | ||||
|     const email = emailInput.value; | ||||
|     const password = passwordInput.value; | ||||
|     const confirmPassword = confirmPasswordInput.value; | ||||
|  | ||||
|     if (name === "" || email === "" || password === "") { | ||||
|         alert("Please fill in all fields."); | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     if (password !== confirmPassword) { | ||||
|         alert("Passwords do not match."); | ||||
|         return; | ||||
|     } | ||||
|  | ||||
|     // Send data to server for processing | ||||
|     const data = { | ||||
|         "name": name, | ||||
|         "email": email, | ||||
|         "password": password, | ||||
|         "plainPassword": password, | ||||
|         "csrf_token": csrfToken | ||||
|         "_token": csrfToken | ||||
|     }; | ||||
|  | ||||
|     fetch("/register", { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user