Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] nested "for" statements
- From: javascript@xxxxxxxxxx (Muchacho, Laurent (TWIi London))
- Subject: [Javascript] nested "for" statements
- Date: Wed, 29 May 2002 10:18:20 +0100
Hi Bill
That possible but you need to use a differente variable for the nested loop
for(var i=0;i<object.length;i++){
alert(object[i]);
for(var j=0;j<object2.length;j++){
alert(object2[j])
}
}
Laurent
-----Original Message-----
From: Bill Marriott [mailto:bill.marriott@xxxxxxxxxxxxxxx]
Sent: 30 May 2002 02:47
To: javascript@xxxxxxxxxx
Subject: Re: [Javascript] nested "for" statements
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;
}
}
}
}
_______________________________________________
Javascript mailing list
Javascript@xxxxxxxxxx
https://lists.LaTech.edu/mailman/listinfo/javascript
DISCLAIMER - The preceding e-mail message (including any attachments)
contains information that may be confidential, may be protected by the
attorney-client or other applicable privileges, or may constitute non-public
information. It is intended to be conveyed only to the designated
recipient(s) named above. If you are not an intended recipient of this
message, or have otherwise received it in error, please notify the sender by
replying to this message and then delete all copies of it from your computer
system. Any use, dissemination, distribution, or reproduction of this
message by unintended recipients is not authorized and may be unlawful. The
contents of this communication do not necessarily represent the views of
this company.
- Follow-Ups:
- [Javascript] nested "for" statements
- From: Bill Marriott
- [Javascript] nested "for" statements
- Prev by Date: [Javascript] unsuscribe
- Next by Date: [Javascript] Underline character in button value (IE)
- Previous by thread: [Javascript] unsuscribe
- Next by thread: [Javascript] nested "for" statements
- Index(es):