-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathscript.js
More file actions
29 lines (25 loc) · 795 Bytes
/
script.js
File metadata and controls
29 lines (25 loc) · 795 Bytes
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
// script.js
// 🔍 Preview selected image in upload.html
function previewImage(event) {
const reader = new FileReader();
reader.onload = function () {
const output = document.getElementById('preview');
output.src = reader.result;
output.style.display = 'block';
};
reader.readAsDataURL(event.target.files[0]);
}
// ✅ Show success alert after form submit
function showSuccess(message) {
alert(message || "Form submitted successfully!");
}
// 🧾 Dummy validation function
function validateLogin() {
const email = document.getElementById("email").value;
const pass = document.getElementById("password").value;
if (!email || !pass) {
alert("Please enter email and password!");
return false;
}
return true;
}