Click to See Complete Forum and Search --> : how to get values from three textboxs in for loop


yu169409
10-22-2003, 08:11 AM
hi
i have three textboxs named start1, start2 and start3. i need to get their values and do some checking. i could use a for loop that runs 3 times, but how would i get the values from them? thank.
for (i=0;i<3;i++){
????help needed here
}

Gollum
10-22-2003, 09:26 AM
well,

assuming your three textboxes are inside a form called f...

for ( i = 1; i <= 3; i++ )
{
alert(document.f['start' + i].value);
}

pelegk1
10-22-2003, 10:39 AM
my mouth

yu169409
10-22-2003, 10:49 AM
thanks, i found that eval() worked as well

fredmv
10-22-2003, 11:02 AM
Originally posted by yu169409
thanks, i found that eval() worked as well However, eval takes more processing power and it doesn't make sense to use when you don't need it.

yu169409
10-22-2003, 05:17 PM
i see. i will use the way provided above