-
Notifications
You must be signed in to change notification settings - Fork 0
/
webApp.js
30 lines (25 loc) · 850 Bytes
/
webApp.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const form = document.getElementById('myForm');
const submitButton = document.getElementById('submitBtn');
submitButton.addEventListener('click', function() {
// Call your function here
validateForm();
// Submit the form
form.submit();
});
function validateForm() {
var username = document.forms["myForm"]["firstname"].value;
var email = document.forms["myForm"]["email"].value;
var password = document.forms["myForm"]["password"].value;
if (username === "") {
alert("Username must be filled out");
return false;
}
if (email === "") {
alert("Username must be filled out");
return false;
}
if (password === "") {
alert("Username must be filled out");
return false;
}
}