Copy link to clipboard
Copied
Hi,
I have a problem. I wrote this java - script to autofill diffrent checkboxes from a selection in a Drop - Down - List, but it doesnt work. Can somebody help me pls? Thanks for helping!
if (event.value == "Modul Ernährung und Gewichtsreduktion") {
this.getField("Check 0").checkThisBox(0,true);
this.getField("Check 4").checkThisBox(0,true);
this.getField("Check 5").checkThisBox(0,true);
this.getField("Check 7").checkThisBox(0,true);
this.getField("Check 15").checkThisBox(0,true);
}
else {
this.getField("Check 0").checkThisBox(0,fals);
this.getField("Check 4").checkThisBox(0,fals);
this.getField("Check 5").checkThisBox(0,fals);
this.getField("Check 7").checkThisBox(0,fals);
this.getField("Check 15").checkThisBox(0,fals);
}
if (event.value == "Modul Bewegung") {
this.getField("Check 0").checkThisBox(0,true);
this.getField("Check 4").checkThisBox(0,true);
this.getField("Check 16").checkThisBox(0,true);
this.getField("Check 81").checkThisBox(0,true);
}
else {
this.getField("Check 0").checkThisBox(0,fals);
this.getField("Check 4").checkThisBox(0,fals);
this.getField("Check 16").checkThisBox(0,fals);
this.getField("Check 81").checkThisBox(0,fals);
}
if (event.value == "Modul entspanntes Leben") {
this.getField("Check 3").checkThisBox(0,true);
this.getField("Check 6").checkThisBox(0,true);
this.getField("Check 9").checkThisBox(0,true);
}
else {
this.getField("Check 3").checkThisBox(0,fals);
this.getField("Check 6").checkThisBox(0,fals);
this.getField("Check 9").checkThisBox(0,fals);
}
The second if resets the checkbox.
Try this:
this.getField("Check 0").checkThisBox(0,false);
this.getField("Check 4").checkThisBox(0,false);
this.getField("Check 5").checkThisBox(0,false);
this.getField("Check 7").checkThisBox(0,false);
this.getField("Check 15").checkThisBox(0,false);
this.getField("Check 16").checkThisBox(0,false);
this.getField("Check 81").checkThisBox(0,false);
this.getField("Check 3").checkThisBox(0,false);
this.getField("Check 6").checkThisBox(0,false);
this.getField("Che
...
Copy link to clipboard
Copied
You must use false, not fals
Copy link to clipboard
Copied
Hallo Bernd,
danke für deine Antwort. Weisst du warum ich beim Auswählen vom Modul Ernährung und Gewichtsreduktion kein Häckchen in der Checkbox 0 bekomme? Dies erscheint nur, wenn ich das zweite Modul auswähle? Kommt dass daher, dass sich hier einzelne Kästchen in den Modulen wiederholen?
Besten Dank für deine Antwort
HG
if (event.value == "Modul Ernährung und Gewichtsreduktion") {
this.getField("Check 0").checkThisBox(0,true);
this.getField("Check 4").checkThisBox(0,true);
this.getField("Check 5").checkThisBox(0,true);
this.getField("Check 7").checkThisBox(0,true);
this.getField("Check 15").checkThisBox(0,true);
}
else {
this.getField("Check 0").checkThisBox(0,false);
this.getField("Check 4").checkThisBox(0,false);
this.getField("Check 5").checkThisBox(0,false);
this.getField("Check 7").checkThisBox(0,false);
this.getField("Check 15").checkThisBox(0,false);
}
if (event.value == "Modul Bewegung") {
this.getField("Check 0").checkThisBox(0,true);
this.getField("Check 4").checkThisBox(0,true);
this.getField("Check 16").checkThisBox(0,true);
this.getField("Check 81").checkThisBox(0,true);
}
else {
this.getField("Check 0").checkThisBox(0,false);
this.getField("Check 4").checkThisBox(0,false);
this.getField("Check 16").checkThisBox(0,false);
this.getField("Check 81").checkThisBox(0,false);
}
if (event.value == "Modul entspanntes Leben") {
this.getField("Check 3").checkThisBox(0,true);
this.getField("Check 6").checkThisBox(0,true);
this.getField("Check 9").checkThisBox(0,true);
}
else {
this.getField("Check 3").checkThisBox(0,false);
this.getField("Check 6").checkThisBox(0,false);
this.getField("Check 9").checkThisBox(0,false);
}
Copy link to clipboard
Copied
The second if resets the checkbox.
Try this:
this.getField("Check 0").checkThisBox(0,false);
this.getField("Check 4").checkThisBox(0,false);
this.getField("Check 5").checkThisBox(0,false);
this.getField("Check 7").checkThisBox(0,false);
this.getField("Check 15").checkThisBox(0,false);
this.getField("Check 16").checkThisBox(0,false);
this.getField("Check 81").checkThisBox(0,false);
this.getField("Check 3").checkThisBox(0,false);
this.getField("Check 6").checkThisBox(0,false);
this.getField("Check 9").checkThisBox(0,false);
if (event.value == "Modul Ernährung und Gewichtsreduktion") {
this.getField("Check 0").checkThisBox(0,true);
this.getField("Check 4").checkThisBox(0,true);
this.getField("Check 5").checkThisBox(0,true);
this.getField("Check 7").checkThisBox(0,true);
this.getField("Check 15").checkThisBox(0,true);
}
if (event.value == "Modul Bewegung") {
this.getField("Check 0").checkThisBox(0,true);
this.getField("Check 4").checkThisBox(0,true);
this.getField("Check 16").checkThisBox(0,true);
this.getField("Check 81").checkThisBox(0,true);
}
if (event.value == "Modul entspanntes Leben") {
this.getField("Check 3").checkThisBox(0,true);
this.getField("Check 6").checkThisBox(0,true);
this.getField("Check 9").checkThisBox(0,true);
}
Copy link to clipboard
Copied
It workes! Thank u verry much!!