Zwei dynamische Auswahlboxen

Begonnen von timb, 01. September 2010, 15:38:18

Vorheriges Thema - Nächstes Thema

timb

Hallo,
ich habe mal wieder ein Problem. Und zwar möchte ich gerne zwei Auswahlboxen nebeneinader machen, so dass man die einträge hin und herschieben kann. Das funktioniert soweit auch gut, aber das Problem ist das Übertragen der Auswahl zum speichern, die ich auf der Seite mehrere dieser Boxen mit einer Schleife erzeuge.
Hier ist mein Quelltext:
 


0)
 {
   theSel.options[theIndex] = null;
 }
}
function moveOptions(theSelFrom, theSelTo)
{
 var selLength = theSelFrom.length;
 var selectedText = new Array();
 var selectedValues = new Array();
 var selectedCount = 0;
 var i;
 // Find the selected Options in reverse order
 // and delete them from the \'from\' Select.
 for(i=selLength-1; i>=0; i--)
 {
   if(theSelFrom.options.selected)
   {
     selectedText[selectedCount] = theSelFrom.options.text;
     selectedValues[selectedCount] = theSelFrom.options.value;
     deleteOption(theSelFrom, i);
     selectedCount++;
   }
 }
 // Add the selected text/values in reverse order.
 // This will add the Options to the \'to\' Select
 // in the same order as they were in the \'from\' Select.
 for(i=selectedCount-1; i>=0; i--)
 {
   addOption(theSelTo, selectedText, selectedValues);
 }
 if(NS4) history.go(0);
}
function placeInHidden(delim, selStr, hidStr)
{
 var selObj = document.getElementById(selStr);
 var hideObj = document.getElementById(hidStr);
 hideObj.value = \'\';
 for (var i=0; i
//hier kommt eine while-Schleife
echo \'
 
\';
echo   \'
   Abteilungen:
 
   optAText1
   optAText2
   optAText3
 
 
 
 

   Auswahl:
\';
echo   \"   \";
echo   \'   
   optAText1
   optAText2
   optAText3
 
 

\';

 
 
Meine Frage ist jetzt wie ich es hin bekomme, dass die Werte von allen Auswahlfelder auf der rechten Seite in ein hidden-Feld gespeichert werden. Das bei jedem einzelnen funktioniert.
Vielen Dank schonmal!

timb


all your base are belong to us