-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupload.js
32 lines (28 loc) · 1.36 KB
/
upload.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
31
32
const semesterSelect = document.getElementById("semester");
const subjectSelect = document.getElementById("subject");
const uploadBtn = document.getElementById("upload-btn");
semesterSelect.addEventListener("change", () => {
const semester = semesterSelect.value;
if (semester === "") {
subjectSelect.innerHTML = "<option value=''>--Select Subject--</option>";
uploadBtn.disabled = true;
} else {
const subjectsBySemester = {
"3": ["Statistics and Probability Theory", "Computer organization & design","Object oriented language", "Introduction to Data Science", "Unix Shell and System Programming", "Previous year paper"],
"4": ["Linear Algebra and its application", "Design and Analysis of Algorithm", " Internet and Web Programming", "Database Management System", "Previous year paper"],
// Add subjects for other semesters as needed
};
subjectSelect.innerHTML = "<option value=''>--Select Subject--</option>";
subjectsBySemester[semester].forEach(subject => {
subjectSelect.innerHTML += `<option value="${subject}">${subject}</option>`;
});
uploadBtn.disabled = false;
}
});
subjectSelect.addEventListener("change", () => {
if (subjectSelect.value === "") {
uploadBtn.disabled = true;
} else {
uploadBtn.disabled = false;
}
});