Hallo,
schreibe momentan an meiner Diplomarbeit an der Uni und muss für den
praktischen Teil eine Online-Auswertung vornehmen. Das Script wird
serverseitig ausgelesen. Dieser Abschnitt funktioniert. Beim JS sollen
nach der Auswahl des Geschlechtes weitere Dropdown-Menüs aktiviert und
diese Werte übergeben werden. An dieser Stelle hängt es (siehe
http://media.anthro.univie.ac.at/my_...its/indexa.php
"test/"4test"). Vielleicht kann mir jemand einen Tip geben, wie ich das
Script noch erweitern muss.
Besten Dank im Voraus!
Peter
function update_auswahl()
{
var sexAuswahl = document.forms.verzeichnis.sex;
var pilleAuswahl = document.forms.verzeichnis.pille;
var hormonAuswahl = document.forms.verzeichnis.hormon;
var pregnantAuswahl = document.forms.verzeichnis.pregnant;
var circleAuswahl = document.forms.verzeichnis.circle;
var cycleAuswahl = document.forms.verzeichnis.cycle;
pilleAuswahl.options.length = 0;
hormonAuswahl.options.length = 0;
pregnantAuswahl.options.length = 0;
circleAuswahl.options.length = 0;
cycleAuswahl.options.length = 0;
// DropDown Menue entleeren
if (sexAuswahl.options[sexAuswahl.selectedIndex].value == "0")
{ //####### BEGINN IF #########
pilleAuswahl.options[0] = new Option("--------");
hormonAuswahl.options[0] = new Option("--------");
pregnantAuswahl.options[0] = new Option("--------");
circleAuswahl.options[0] = new Option("---------");
cycleAuswahl.options[0] = new Option("------------------");
}
if (sexAuswahl.options[sexAuswahl.selectedIndex].value == "1")
{ pilleAuswahl.options[0] = new Option("--------");
hormonAuswahl.options[0] = new Option("--------");
pregnantAuswahl.options[0] = new Option("--------");
circleAuswahl.options[0] = new Option("---------");
cycleAuswahl.options[0] = new Option("------------------");
} //######### BEGINN ELSE IF ########
else if (sexAuswahl.options[sexAuswahl.selectedIndex].value == "2")
{ //######### BEGINN ELSE IF ########
pilleAuswahl.options[0] = new Option("[Auswahl]");
pilleAuswahl.options[1] = new Option("Nein");
pilleAuswahl.options[2] = new Option("Ja");
hormonAuswahl.options[0] = new Option("[Auswahl]");
hormonAuswahl.options[1] = new Option("Nein");
hormonAuswahl.options[2] = new Option("Ja");
pregnantAuswahl.options[0] = new Option("[Auswahl]");
pregnantAuswahl.options[1] = new Option("Nein");
pregnantAuswahl.options[2] = new Option("Ja");
circleAuswahl.options[0] = new Option("[Auswahl]");
circleAuswahl.options[21] = new Option("< 22 Tage");
circleAuswahl.options[22] = new Option("22 Tage");
circleAuswahl.options[23] = new Option("23 Tage");
circleAuswahl.options[24] = new Option("24 Tage");
circleAuswahl.options[25] = new Option("25 Tage");
circleAuswahl.options[26] = new Option("26 Tage");
circleAuswahl.options[27] = new Option("27 Tage");
circleAuswahl.options[28] = new Option("28 Tage");
circleAuswahl.options[29] = new Option("29 Tage");
circleAuswahl.options[30] = new Option("30 Tage");
circleAuswahl.options[31] = new Option("31 Tage");
circleAuswahl.options[32] = new Option("32 Tage");
circleAuswahl.options[33] = new Option("33 Tage");
circleAuswahl.options[34] = new Option("34 Tage");
circleAuswahl.options[35] = new Option("35 Tage");
circleAuswahl.options[36] = new Option("36 Tage");
circleAuswahl.options[37] = new Option("37 Tage");
circleAuswahl.options[38] = new Option("38 Tage");
circleAuswahl.options[39] = new Option("> 38 Tage");
cycleAuswahl.options[0] = new Option("[Auswahl]");
cycleAuswahl.options[1] = new Option("ist sehr regelmäßig");
cycleAuswahl.options[2] = new Option("schwankt etwa 1 Tag");
cycleAuswahl.options[3] = new Option("schwankt bis 1 Woche");
cycleAuswahl.options[4] = new Option("ist sehr unregelmäßig");
} //########### ENDE ELSE IF ###########
}
HTML:
<font size="+1" face="Verdana, Arial, Helvetica, sans-serif">
Ich nehme die Pille
</font>
<select name="pille" id="pille" size="1"
onchange="pilleAuswahl.options(this.value)">
<option selected value="0">
--------
</option>
</select>
<font size="+1" face="Verdana, Arial, Helvetica, sans-serif">
Nehme andere Hormonpräparate
</font>
<select name="hormon" id="hormon" size="1"
onchange="hormonAuswahl.options(this.value)">
<option selected value="0">
--------
</option>
</select>
<font size="+1" face="Verdana, Arial, Helvetica, sans-serif">
Ich bin schwanger
</font>
<select name="pregnant" id="pregnant" size="1"
onchange="pregnantAuswahl.options(this.value)">
<option selected value="0">
--------
</option>
</select>
<font size="+1" face="Verdana, Arial, Helvetica, sans-serif">
Mein monatlicher Zyklus dauert
</font>
</b>
<select name="circle" id="circle" size="1"
onchange="circleAuswahl.options(this.value)">
<option selected value="0">
---------
</option>
</select>
<font size="+1" face="Verdana, Arial, Helvetica, sans-serif">
Mein Zyklus
<select name="cycle" id="cycle" size="1"
onchange="cycleAuswahl.otions(this.value)">
<option selected value="0">
------------------
</option>
</select>