-
Notifications
You must be signed in to change notification settings - Fork 0
/
selectEntry.html
executable file
·60 lines (44 loc) · 1.38 KB
/
selectEntry.html
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html>
<head>
<title>Data analysis and report generation tool</title>
</head>
<body>
<fieldset>
<legend> Select the course for Entry</legend>
<label>Course</label>
<script>
var course;
</script>
<select required id= "course" onchange="listsem()">
<option value="MCA"> MCA</option>
<option value="MTECH">M Tech </option>
<option value="MBA">MBA</option>
<option value="BCOM">B.COM</option>
<option></option>
</select>
<label>Semester</label>
<select id ="semesterList"> </select>
</fieldset>
<script >
function listsem(){
var x=document.getElementById("course").selectedIndex;
var y=document.getElementById("course").options;
var semList = 0;
if (y[x].text == "MCA"){ semList = 12;}
else if (y[x].text == "M Tech"){ semList = 12;}
else if (y[x].text == "MBA"){ semList = 12;}
else { semList = 6;}
//alert("Index: " + y[x].index + " is " + y[x].text + "semlist" + semList);
// here is a small bug for semester list update on change.
var s = document.getElementById("semesterList");
var i =0;
if (s.options.length >= 12 ){s.options.length = 0;}
for(i = 0;i < semList;i++){
s.options[s.options.length]= new Option(i+1, s.options.length + 1);
}
}
</script>
</form>
</body>
</html>