add: new js files for simplicity
This commit is contained in:
@@ -10,15 +10,13 @@ registerBtn.addEventListener("click", handleSubmit);
|
||||
|
||||
// Function to handle form submission
|
||||
function handleSubmit(event) {
|
||||
// Prevent default form submission behavior
|
||||
event.preventDefault();
|
||||
|
||||
// Validate input
|
||||
const name = nameInput.value;
|
||||
const email = emailInput.value;
|
||||
const password = passwordInput.value;
|
||||
|
||||
if (name === "" || email === "" || password === "") {
|
||||
event.preventDefault();
|
||||
alert("Please fill in all fields.");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user