Commit 198d7c7c authored by Dominik Schuhmann's avatar Dominik Schuhmann
Browse files

checkboxes finally

parent f2338a4b
......@@ -30,28 +30,47 @@
</div>
<h3 style = "text-align: center">Checkbox 2</h3>
<div style="text-align: center">
<input type="checkbox" id="unit" class="checkboxunit" name="horns" style onclick="myfunction()">
<input type="checkbox" id="rgbUnit" class="checkboxunit" name="horns" style onclick="myfunction()">
</div>
<h3 style = "text-align: center">Checkbox 3</h3>
<div style="text-align: center">
<input type="checkbox" id="rgbUnit" class="checkboxunit" name="horns" style onclick="myfunction()">
<input type="checkbox" id="pir" class="checkboxunit" name="horns" style onclick="myfunction()">
</div>
<h3 style = "text-align: center">Checkbox 4</h3>
<div style="text-align: center">
<input type="checkbox" id="hub" class="checkboxunit" name="horns" style onclick="myfunction()">
<input type="checkbox" id="dual-B" class="checkboxunit" name="horns" style onclick="myfunction()">
</div>
<h3 style = "text-align: center">Checkbox 5</h3>
<div style="text-align: center">
<input type="checkbox" id="dual-B" class="checkboxunit" name="horns" style onclick="myfunction()">
<input type="checkbox" id="color" class="checkboxunit" name="horns" style onclick="myfunction()">
</div>
<h3 style = "text-align: center">Checkbox 6</h3>
<div style="text-align: center">
<input type="checkbox" id="pir" class="checkboxunit" name="horns" style onclick="myfunction()">
<input type="checkbox" id="env" class="checkboxunit" name="horns" style onclick="myfunction()">
</div>
<div style="text-align: center">
<input type="checkbox" id="cardkb" class="checkboxunit" name="horns" style onclick="myfunction()">
</div>
<div style="text-align: center">
<input type="checkbox" id="rfid" class="checkboxunit" name="horns" style onclick="myfunction()">
</div>
<div style="text-align: center">
<input type="checkbox" id="finger" class="checkboxunit" name="horns" style onclick="myfunction()">
</div>
<!--mehrere Units müssen mit einem Semikolon unterteilt werden-->
<h3 style = "text-align: center">Checkbox 7 pir and rgb</h3>
<h3 style = "text-align: center">Mehrere Units</h3>
<div style="text-align: center">
<input type="checkbox" id="rgbUnit;pir" class="checkboxunit" name="horns" style onclick="myfunction()">
</div>
<div style="text-align: center">
<input type="checkbox" id="rgbUnit;dual-B" class="checkboxunit" name="horns" style onclick="myfunction()">
</div>
<div style="text-align: center">
<input type="checkbox" id="cardkb;rgbUnit" class="checkboxunit" name="horns" style onclick="myfunction()">
</div>
<div style="text-align: center">
<input type="checkbox" id="rfid;rgbUnit" class="checkboxunit" name="horns" style onclick="myfunction()">
</div>
<div style="text-align: center">
<input type="checkbox" id="pir;rgbUnit" class="checkboxunit" name="horns" style onclick="myfunction()">
<input type="checkbox" id="finger;rgbUnit" class="checkboxunit" name="horns" style onclick="myfunction()">
</div>
<!--<div>
<h1>Resultar.</h1>
......
function myfunction() {
//deklaration aller checkboxen, mit dem namen der Unit als ID und eine checked function
var check1 = document.getElementById('stack');
var check2 = document.getElementById('unit');
var check3 = document.getElementById('rgbUnit');
var check4 = document.getElementById('hub');
var check5 = document.getElementById('dual-B');
var check6 = document.getElementById('pir');
var check7 = document.getElementById('pir;rgbUnit')
var check2 = document.getElementById('rgbUnit');
var check3 = document.getElementById('pir');
var check4 = document.getElementById('dual-B');
var check5 = document.getElementById('color');
var check6 = document.getElementById('env');
//row2
var check7 = document.getElementById('cardkb');
var check8 = document.getElementById('rfid');
var check9 = document.getElementById('finger');
var checkmore1 = document.getElementById('rgbUnit;pir');
var checkmore2 = document.getElementById('rgbUnit;dual-B');
//row3
var checkmore3 = document.getElementById('cardkb;rgbUnit');
var checkmore4 = document.getElementById('rfid;rgbUnit');
var checkmore5 = document.getElementById('finger;rgbUnit');
var array = [];
if (check1.checked == true) {
array.push(check1.id);
......@@ -29,6 +41,28 @@ function myfunction() {
if (check7.checked == true) {
array.push(split(check7.id));
}
if (check8.checked == true) {
array.push(split(check8.id));
}
if (check9.checked == true) {
array.push(split(check9.id));
}
if (checkmore1.checked == true) {
array.push(split(checkmore1.id));
}
if (checkmore2.checked == true) {
array.push(split(checkmore2.id));
}
if (checkmore3.checked == true) {
array.push(split(checkmore3.id));
}
if (checkmore4.checked == true) {
array.push(split(checkmore4.id));
}
if (checkmore5.checked == true) {
array.push(split(checkmore5.id));
}
getmoeglicheAufgaben(array);
}
//function to split more Units IDs
......@@ -43,6 +77,9 @@ function getmoeglicheAufgaben(array){
var leuchtenpir = [["pir"],"http://nerd40.ce.jku.at/?page_id=594", "Licht leuchten lassen mit Bewegungssensor"];
var ledsbewegungssensor =[["rgbUnit","pir"], "http://nerd40.ce.jku.at/?page_id=940", "LEDs leuchten lassen mithilfe eines Bewegungssensors"];
var dual_rgb =[["rgbUnit","dual-B"], "http://nerd40.ce.jku.at/?page_id=948", "Farben mittels Knopfdruck ändern"];
var alleaufgaben =[];
//deklaration der Infoseiten
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment