[Javascript] nested "for" statements

Bill Marriott bill.marriott at optusnet.com.au
Wed May 29 20:47:03 CDT 2002


Hi Everyone,

I'm trying to get nested "for" statements to run in order to get the
selected options from a number of  multiple select boxes. See code below.
Does anyone know if it isn't possible? At present it only runs for the first
select box.

regards

Bill

for(i=1;i<=document.Crystal.NumOfParM.value;i++)
   {
     var ObjM = document.getElementById("paraM" +i);
     if (ObjM != "" || ObjM != null)
      {
        for (var i=0, l=ObjM.options.length;i<l;i++)
           {
             if (ObjM.options[i].selected)
                {
                  valSF = valSF + "AND" + ObjM.options[i].value;
                }
           }
      }
   }





More information about the Javascript mailing list