-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdynamicDropdowns.js
44 lines (36 loc) · 1.36 KB
/
dynamicDropdowns.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
33
34
35
36
37
38
39
40
41
42
43
44
function setOptions(chosen, selbox, index) {
//var selbox = ;
selbox.options.length = 0;
if (chosen == " ") {
selbox.options[selbox.options.length] = new Option('First Select Tag type',' ');
}
if (chosen == "ol") {
selbox.options[selbox.options.length] = new Option(' ',' ');
selbox.options[selbox.options.length] = new Option('Roman','Roman');
}
if (chosen == "pre") {
selbox.options[selbox.options.length] = new Option('SQL','SQL');
selbox.options[selbox.options.length] = new Option('Bash','bash');
}
if (chosen == "p") {
selbox.options[selbox.options.length] = new Option(' ',' ');
selbox.options[selbox.options.length] = new Option('padding20','padding20');
}
if (chosen == "a") {
document.getElementById("href_label_node_"+index).style.display="block";
document.getElementById("href_input_node_"+index).style.display="block";
}
else
{
document.getElementById("href_label_node_"+index).style.display="none";
document.getElementById("href_input_node_"+index).style.display="none";
}
if (chosen == "p" || chosen == "ol" || chosen == "ul" || chosen == "li")
{
document.getElementById("child_button_node_"+index).style.display="block";
}
else
{
document.getElementById("child_button_node_"+index).style.display="none";
}
}