We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 37d7fa5 commit bcc0d32Copy full SHA for bcc0d32
sampleprgm.js
@@ -0,0 +1,26 @@
1
+const form = document.querySelector('form');
2
+
3
+form.addEventListener('submit', (e) => {
4
+ e.preventDefault();
5
6
+ const email = document.getElementById('email').value.trim();
7
+ const password = document.getElementById('password').value.trim();
8
9
+ if (!email || !password) {
10
+ alert('Please fill in all fields');
11
+ return;
12
+ }
13
14
+ if (!email.includes('@')) {
15
+ alert('Please enter a valid email');
16
17
18
19
+ if (password.length < 6) {
20
+ alert('Password must be at least 6 characters');
21
22
23
24
+ console.log('Login submitted:', { email, password });
25
+ alert('Login successful!');
26
+});
0 commit comments