Also folgender Quelltext und nun sollte
<input type="hidden" name="jobkategorie[]Content" value="">
<script language="JavaScript">
function Fsrch_category_migrateOption() {
var optionId;
var i=0;
var aSelect = eval("document.forms[0].jobkategorie[]");
do {
if (aSelect.length>i && aSelect.options[i].selected) optionId = aSelect.options[i].value;
i++;
} while( i<aSelect.length && (optionId == null || optionId == "") );
if ( optionId == "" || optionId == null ) return;
var i;
for(i=1; i<2; i++) {
eval("document.forms[0].Fsrch_category_category" + i + ".options.length = 0");
}
Fsrch_category_migrateOptionList(0, optionId);
}
function Fsrch_category_areRelated(testOptionId, baseOptionId) {
var optionArray;
var parentId = baseOptionId;
do {
if (testOptionId == parentId)
return true;
optionArray = eval("window.array_Fsrch_category_"+parentId);
if (optionArray)
parentId = optionArray[0][1];
} while (optionArray && parentId != null && parentId != "");
return false;
}
function Fsrch_category_migrateOptionList(level, selectedId) {
var aSelect = eval("document.forms[0].Fsrch_category_category" + level);
var n = aSelect.length;
var i;
for(i=1; i<n; i++) {
var anOption = aSelect.options[i].value;
if ( Fsrch_category_areRelated(anOption, selectedId) ) {
aSelect.options[i].selected = true;
var optionListArray = eval("window.array_Fsrch_category_"+anOption);
if ( optionListArray && optionListArray.length > 1 ) {
aSelect = eval("document.forms[0].Fsrch_category_category" + (level+1));
n = optionListArray.length;
for(i=0; i<n; i++) {
var optionId;
var optionName;
if (i==0) {
optionId = anOption;
optionName = "*";
}
else {
optionId = optionListArray[i];
optionName = eval("array_Fsrch_category_"+optionId+"[0][0]");
}
aSelect.options[i] = new Option(optionName,optionId);
}
Fsrch_category_migrateOptionList(level+1, selectedId);
return;
}
}
}
}
function Fsrch_category_searchParent(searchId, parentId) {
var anArray = eval("window.array_Fsrch_category_" + parentId);
var j;
if (anArray) {
for(j=1; j<anArray.length; j++) {
if (anArray[j] == searchId) {
return anArray[j];
}
else {
var found = Fsrch_category_searchParent(searchId, anArray[j]);
if (found != null) return found;
}
}
}
return null;
}
function Fsrch_category_checkForParent(optionId) {
var aSelect = eval("document.forms[0].jobkategorie[]");
var i;
for(i=0; i<aSelect.length; i++) {
var found = Fsrch_category_searchParent(optionId, aSelect.options[i].value);
if (found != null) return aSelect.options[i].text;
}
return null;
}
function Fsrch_category_checkForChilds(optionId, selectIt) {
var childArray = new Array();
var aSelect = eval("document.forms[0].jobkategorie[]");
var i;
for(i=0; i<aSelect.length; i++) {
var found = Fsrch_category_searchParent(aSelect.options[i].value, optionId);
if (found != null) {
childArray[childArray.length] = aSelect.options[i].value;
if (selectIt) aSelect.options[i].selected = true;
}
}
if (childArray.length>0) return childArray;
return null;
}
function Fsrch_category_collectOptions() {
var aSelect = eval("document.forms[0].jobkategorie[]");
document.forms[0].jobkategorie[]Content.value = "";
for(i=0; i<aSelect.length; i++) {
if (i>0) document.forms[0].jobkategorie[]Content.value += "|";
document.forms[0].jobkategorie[]Content.value += aSelect.options[i].value;
}
}
collectArray[collectArray.length] = "Fsrch_category";
function Fsrch_category_getLeftOptionAsId() {
var aSelect = null;
if (aSelect == null || aSelect.selectedIndex == -1) {
aSelect = document.forms[0].Fsrch_category_category1;
}
if (aSelect == null || aSelect.selectedIndex == -1) {
aSelect = document.forms[0].Fsrch_category_category0;
}
if ( aSelect != null && aSelect.selectedIndex != -1 && aSelect.options[aSelect.selectedIndex].value != "RootOptionList") {
return aSelect.options[aSelect.selectedIndex].value;
}
else return "";
}
function Fsrch_category_addOption() {
var optionId = Fsrch_category_getLeftOptionAsId();
if (optionId != "") {
var optionText = eval("array_Fsrch_category_"+optionId+"[0][0]");
var parent = Fsrch_category_checkForParent(optionId);
if (parent != null) {
alert("" + optionText + " ist ein Teil von " + parent + ".\nSie müssen erst " + parent + " löschen, um " + optionText + " hinzufügen zu können.");
return;
}
var aSelect = eval("document.forms[0].jobkategorie[]");
for(i=0; i<aSelect.length; i++) {
if (aSelect.options[i].value == optionId) {
alert("Sie haben diese Option schon hinzugefügt ");
return;
}
}
var childArray = Fsrch_category_checkForChilds(optionId, true);
if (childArray != null) {
alert("Teile aus " + optionText + " wurden bereits ausgewählt.\nLöschen Sie die markierten Elemente, bevor Sie " + optionText + " hinzufügen.");
return;
}
var newOption = "new Option('"+optionText+"', '"+optionId+"')";
if (aSelect) aSelect.options[aSelect.length] = eval(newOption);
}
else alert("Wählen Sie zuerst eine Option aus der Auswahlbox aus.");
}
function Fsrch_category_removeOption() {
var textArray = new Array();
var valueArray = new Array();
var cnt = 0;
var aSelect = eval("document.forms[0].jobkategorie[]");
for(i=0; i<aSelect.length; i++) {
if (!aSelect.options[i].selected) {
textArray[cnt] = aSelect.options[i].text;
valueArray[cnt] = aSelect.options[i].value;
cnt++;
}
}
if (aSelect.length==cnt) {
alert("Markieren Sie bitte zuerst etwas in der Liste unten.");
return; }
for(i=aSelect.lenght-1; i>=0; i--) {
aSelect.options[i] = null;
}
aSelect.options.length = 0;
for (i = 0; i < cnt ; i++) {
aSelect.options[aSelect.length] = new Option(textArray[i], valueArray[i], false, false);
}
aSelect.selectedIndex = -1;
}
</script>
<table cellpadding="0" cellspacing="0" border="0"><tr>
<td align="left" colspan="2">
<SCRIPT LANGUAGE="JavaScript">
<!--
function Fsrch_category_populateOptions(id) {
var i;
var aSelect;
for(i=id+1; i<2; i++) {
aSelect = eval("document.forms[0].Fsrch_category_category" + i);
aSelect.options.length = 0;
aSelect.selectedIndex = -1;
}
aSelect = eval("document.forms[0].Fsrch_category_category" + id);
var s = aSelect.options[aSelect.selectedIndex].value;
var selectedArray = eval("window.array_Fsrch_category_"+s);
if (!selectedArray || selectedArray.length<=1)
{
aSelect = eval("document.forms[0].Fsrch_category_category" + (id+1))
aSelect.options.length = 0;
for (i = 0; i < 5; i++)
{
aSelect.options[i] = new Option("","");
}
return;
}
var idx = aSelect.selectedIndex;
if (aSelect.options[idx].text == "*") return;
if (aSelect.options[idx].text == "-") return;
aSelect = eval("document.forms[0].Fsrch_category_category" + (id+1));
for(i=0; i<selectedArray.length; i++) {
var optionId;
var optionName;
if (i==0) {
optionId = s;
optionName = "*";
}
else {
optionId = selectedArray[i];
optionName = eval("array_Fsrch_category_"+optionId+"[0][0]");
}
aSelect.options[i] = new Option(optionName,optionId);
}
}
var lookup_Fsrch_category = new Array("002_120_000_000","(Natur-) Wissenschaft & Forschung","002_120_010_000","Beratung: Wissenschaft & Forschung"
//HIER STEHEN DIE RESTLICHEN FÜLLWERTE........
,"theend: 233");
var tree_Fsrch_category = new Array("0,-1,0,1,2,3,4,5,6,7,8,9,10,11",
"1,0,1",
//usw.....
"230,227,1","231,227,1","232,227,1","theend");
for (i=0; i<tree_Fsrch_category.length-1; i++) {
splitted = tree_Fsrch_category[i].split(",");
id = lookup_Fsrch_category[parseInt(splitted[0]) * 2];
aName = lookup_Fsrch_category[parseInt(splitted[0]) * 2 + 1];
s = "var array_Fsrch_category_" + id + " = new Array(new Array(\"" + aName + "\",";
myParent = parseInt(splitted[1]);
if (myParent == -1) {
s = s + "\"\"";
}
else {
s = s + "\"" + lookup_Fsrch_category[myParent * 2] + "\"";
}
s = s + "," + splitted[2] + ")";
for (idsearch=3; idsearch<splitted.length; idsearch++) {
s = s + ",\"" + lookup_Fsrch_category[parseInt(splitted[idsearch]) * 2] + "\"";
}
s = s + ");";
eval(s);
}
// -->
</script>
<input type="hidden" name="jobkategorie[]Content" value="">
<script language="JavaScript">
function Fsrch_category_migrateOption() {
var optionId;
var i=0;
var aSelect = eval("document.forms[0].jobkategorie[]");
do {
if (aSelect.length>i && aSelect.options[i].selected) optionId = aSelect.options[i].value;
i++;
} while( i<aSelect.length && (optionId == null || optionId == "") );
if ( optionId == "" || optionId == null ) return;
var i;
for(i=1; i<2; i++) {
eval("document.forms[0].Fsrch_category_category" + i + ".options.length = 0");
}
Fsrch_category_migrateOptionList(0, optionId);
}
function Fsrch_category_areRelated(testOptionId, baseOptionId) {
var optionArray;
var parentId = baseOptionId;
do {
if (testOptionId == parentId)
return true;
optionArray = eval("window.array_Fsrch_category_"+parentId);
if (optionArray)
parentId = optionArray[0][1];
} while (optionArray && parentId != null && parentId != "");
return false;
}
function Fsrch_category_migrateOptionList(level, selectedId) {
var aSelect = eval("document.forms[0].Fsrch_category_category" + level);
var n = aSelect.length;
var i;
for(i=1; i<n; i++) {
var anOption = aSelect.options[i].value;
if ( Fsrch_category_areRelated(anOption, selectedId) ) {
aSelect.options[i].selected = true;
var optionListArray = eval("window.array_Fsrch_category_"+anOption);
if ( optionListArray && optionListArray.length > 1 ) {
aSelect = eval("document.forms[0].Fsrch_category_category" + (level+1));
n = optionListArray.length;
for(i=0; i<n; i++) {
var optionId;
var optionName;
if (i==0) {
optionId = anOption;
optionName = "*";
}
else {
optionId = optionListArray[i];
optionName = eval("array_Fsrch_category_"+optionId+"[0][0]");
}
aSelect.options[i] = new Option(optionName,optionId);
}
Fsrch_category_migrateOptionList(level+1, selectedId);
return;
}
}
}
}
function Fsrch_category_searchParent(searchId, parentId) {
var anArray = eval("window.array_Fsrch_category_" + parentId);
var j;
if (anArray) {
for(j=1; j<anArray.length; j++) {
if (anArray[j] == searchId) {
return anArray[j];
}
else {
var found = Fsrch_category_searchParent(searchId, anArray[j]);
if (found != null) return found;
}
}
}
return null;
}
function Fsrch_category_checkForParent(optionId) {
var aSelect = eval("document.forms[0].jobkategorie[]");
var i;
for(i=0; i<aSelect.length; i++) {
var found = Fsrch_category_searchParent(optionId, aSelect.options[i].value);
if (found != null) return aSelect.options[i].text;
}
return null;
}
function Fsrch_category_checkForChilds(optionId, selectIt) {
var childArray = new Array();
var aSelect = eval("document.forms[0].jobkategorie[]");
var i;
for(i=0; i<aSelect.length; i++) {
var found = Fsrch_category_searchParent(aSelect.options[i].value, optionId);
if (found != null) {
childArray[childArray.length] = aSelect.options[i].value;
if (selectIt) aSelect.options[i].selected = true;
}
}
if (childArray.length>0) return childArray;
return null;
}
function Fsrch_category_collectOptions() {
var aSelect = eval("document.forms[0].jobkategorie[]");
document.forms[0].jobkategorie[]Content.value = "";
for(i=0; i<aSelect.length; i++) {
if (i>0) document.forms[0].jobkategorie[]Content.value += "|";
document.forms[0].jobkategorie[]Content.value += aSelect.options[i].value;
}
}
collectArray[collectArray.length] = "Fsrch_category";
function Fsrch_category_getLeftOptionAsId() {
var aSelect = null;
if (aSelect == null || aSelect.selectedIndex == -1) {
aSelect = document.forms[0].Fsrch_category_category1;
}
if (aSelect == null || aSelect.selectedIndex == -1) {
aSelect = document.forms[0].Fsrch_category_category0;
}
if ( aSelect != null && aSelect.selectedIndex != -1 && aSelect.options[aSelect.selectedIndex].value != "RootOptionList") {
return aSelect.options[aSelect.selectedIndex].value;
}
else return "";
}
function Fsrch_category_addOption() {
var optionId = Fsrch_category_getLeftOptionAsId();
if (optionId != "") {
var optionText = eval("array_Fsrch_category_"+optionId+"[0][0]");
var parent = Fsrch_category_checkForParent(optionId);
if (parent != null) {
alert("" + optionText + " ist ein Teil von " + parent + ".\nSie müssen erst " + parent + " löschen, um " + optionText + " hinzufügen zu können.");
return;
}
var aSelect = eval("document.forms[0].jobkategorie[]");
for(i=0; i<aSelect.length; i++) {
if (aSelect.options[i].value == optionId) {
alert("Sie haben diese Option schon hinzugefügt ");
return;
}
}
var childArray = Fsrch_category_checkForChilds(optionId, true);
if (childArray != null) {
alert("Teile aus " + optionText + " wurden bereits ausgewählt.\nLöschen Sie die markierten Elemente, bevor Sie " + optionText + " hinzufügen.");
return;
}
var newOption = "new Option('"+optionText+"', '"+optionId+"')";
if (aSelect) aSelect.options[aSelect.length] = eval(newOption);
}
else alert("Wählen Sie zuerst eine Option aus der Auswahlbox aus.");
}
function Fsrch_category_removeOption() {
var textArray = new Array();
var valueArray = new Array();
var cnt = 0;
var aSelect = eval("document.forms[0].jobkategorie[]");
for(i=0; i<aSelect.length; i++) {
if (!aSelect.options[i].selected) {
textArray[cnt] = aSelect.options[i].text;
valueArray[cnt] = aSelect.options[i].value;
cnt++;
}
}
if (aSelect.length==cnt) {
alert("Markieren Sie bitte zuerst etwas in der Liste unten.");
return; }
for(i=aSelect.lenght-1; i>=0; i--) {
aSelect.options[i] = null;
}
aSelect.options.length = 0;
for (i = 0; i < cnt ; i++) {
aSelect.options[aSelect.length] = new Option(textArray[i], valueArray[i], false, false);
}
aSelect.selectedIndex = -1;
}
</script>
<table cellpadding="0" cellspacing="0" border="0"><tr>
<td align="left" colspan="2">
<SCRIPT LANGUAGE="JavaScript">
<!--
function Fsrch_category_populateOptions(id) {
var i;
var aSelect;
for(i=id+1; i<2; i++) {
aSelect = eval("document.forms[0].Fsrch_category_category" + i);
aSelect.options.length = 0;
aSelect.selectedIndex = -1;
}
aSelect = eval("document.forms[0].Fsrch_category_category" + id);
var s = aSelect.options[aSelect.selectedIndex].value;
var selectedArray = eval("window.array_Fsrch_category_"+s);
if (!selectedArray || selectedArray.length<=1)
{
aSelect = eval("document.forms[0].Fsrch_category_category" + (id+1))
aSelect.options.length = 0;
for (i = 0; i < 5; i++)
{
aSelect.options[i] = new Option("","");
}
return;
}
var idx = aSelect.selectedIndex;
if (aSelect.options[idx].text == "*") return;
if (aSelect.options[idx].text == "-") return;
aSelect = eval("document.forms[0].Fsrch_category_category" + (id+1));
for(i=0; i<selectedArray.length; i++) {
var optionId;
var optionName;
if (i==0) {
optionId = s;
optionName = "*";
}
else {
optionId = selectedArray[i];
optionName = eval("array_Fsrch_category_"+optionId+"[0][0]");
}
aSelect.options[i] = new Option(optionName,optionId);
}
}
var lookup_Fsrch_category = new Array("002_120_000_000","(Natur-) Wissenschaft & Forschung","002_120_010_000","Beratung: Wissenschaft & Forschung"
//HIER STEHEN DIE RESTLICHEN FÜLLWERTE........
,"theend: 233");
var tree_Fsrch_category = new Array("0,-1,0,1,2,3,4,5,6,7,8,9,10,11",
"1,0,1",
//usw.....
"230,227,1","231,227,1","232,227,1","theend");
for (i=0; i<tree_Fsrch_category.length-1; i++) {
splitted = tree_Fsrch_category[i].split(",");
id = lookup_Fsrch_category[parseInt(splitted[0]) * 2];
aName = lookup_Fsrch_category[parseInt(splitted[0]) * 2 + 1];
s = "var array_Fsrch_category_" + id + " = new Array(new Array(\"" + aName + "\",";
myParent = parseInt(splitted[1]);
if (myParent == -1) {
s = s + "\"\"";
}
else {
s = s + "\"" + lookup_Fsrch_category[myParent * 2] + "\"";
}
s = s + "," + splitted[2] + ")";
for (idsearch=3; idsearch<splitted.length; idsearch++) {
s = s + ",\"" + lookup_Fsrch_category[parseInt(splitted[idsearch]) * 2] + "\"";
}
s = s + ");";
eval(s);
}
// -->
</script>
Kommentar