Hej, har tre dynamiska dropdownboxar som skiftar med valen i den första osv... Jag får bara ut värdet eller datat i den första, med det första valet man gör, men inte i den andra, resp den tredje.
kod för att få ut värdet från den första:
document.myChoices.firstChoice[document.myChoices.firstChoice.selectedIndex].text
//***************************************************
function selectChange(control, controlToPopulate, ItemArray, GroupArray, ValueArray)
{
var myEle ;
var x ;
// Empty the second drop down box of any choices
for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
if (control.name == "firstChoice") {
// Empty the third drop down box of any choices
for (var q=myChoices.thirdChoice.options.length;q>=0;q--) myChoices.thirdChoice.options[q] = null;
}
// ADD Default Choice - in case there are no values
myEle = document.createElement("option") ;
myEle.value = 0 ;
myEle.text = "[Valj]" ;
controlToPopulate.add(myEle) ;
// Now loop through the array of individual items
// Any containing the same child id are added to
// the second dropdown box
for ( x = 0 ; x < ItemArray.length ; x++ )
{
if ( GroupArray[x] == control.value )
{
myEle = document.createElement("option") ;
myEle.value = x ;
myEle.text = ItemArray[x] ;
controlToPopulate.add(myEle) ;
}
}
}
// och här för att lägga in i selectboxarna! som du ser måste jag ha värderna för att sätta de till cookies!! Vi behöver inte gå inpå varför! Men det behövs..iaf..