<!DOCTYPE html>
<html>
<head>
</head>
<script>
function auswahl() {
prim=document.getElementById("mySelect").value;
document.getElementById("selectName").innerHTML = "Der erste Ton ist: "+" " + prim;
a = ["c", "c#", "d", "d#", "e", "f", "f#", "g", "g#", "a", "bb", "h"];
b=a.indexOf(prim);
c=a.splice(b);
d=a.splice(0,b);
ton = c.concat(d);
tonL = ( ton[2]+", "+ton[4]+", "+ton[5]+", "+ton[7]+", "+ton[9]+", "+ton[11]);
}
function pruefen() {
ton2 = (document.tonleiter.ton2.value);
ton3 = (document.tonleiter.ton3.value);
ton4 = (document.tonleiter.ton4.value);
ton5 = (document.tonleiter.ton5.value);
ton6 = (document.tonleiter.ton6.value);
ton7 = (document.tonleiter.ton7.value);
if ( ton2==""|| ton3==""|| ton4==""|| ton5==""|| ton6==""|| ton7==""){
alert("Bitte alle Felder ausfuellen.")
return false;
}
if ( ton2!=ton[2]|| ton3!=ton[4]|| ton4!=ton[5]|| ton5!=ton[7]|| ton6!=ton[9]|| ton7!=ton[11]){
alert("mindestens ein ton ist falsch")
}else{
alert("Alles Richtig.");
}
}
</script>
<body>
<form name="tonleiter">
<select id="mySelect" onchange="auswahl()">
<option value="Auswahl">1.Ton</option>
<option value="c">c</option>
<option value="d">d</option>
<option value="e">e</option>
<option value="f">f</option>
<option value="g">g</option>
<option value="a">a</option>
<option value="h">h</option>
</select>
<br>
<input type="text" name="ton2" placeholder="2.Ton" size="2"required><br>
<input type="text" name="ton3"placeholder="3.Ton" size="2"required><br>
<input type="text" name="ton4"placeholder="4.Ton" size="2"required><br>
<input type="text" name="ton5"placeholder="5.Ton" size="2"required><br>
<input type="text" name="ton6"placeholder="6.Ton" size="2"required><br>
<input type="text" name="ton7"placeholder="7.Ton" size="2"required><br>
<input type="button" value="check" onclick="pruefen()"><br>
<input type="reset">
</form>
<p id="selectName"</p>
</body>
</html>