Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looping through a variable number of Form's Fields

Status
Not open for further replies.

MP498T

MIS
Mar 14, 2001
15
GB
I'm able to read values currently populating fields in a form from a different frame in the html page and get their values. e.g.
Code:
AssyUID = Parent.AssyUIDframe.frmAssyUID.fldAssyUID_1.value
However my form in the other frame is produced dynamically in asp and there can be a varying number of fields from 1 to n and the form’s field names are logically coded as created AssyUID_1 to AssyUID_n e.g. AssyUID_1, AssyUID_2, AssyUID_3.

The script I’m running knows n (the number of fields) so how can I loop through each one of these fields one at a time and get their values?

For testing I'm using a For Next loop to populate an array i.e. what I'm trying to achieve is the equivalent of
Code:
For i = 1 to n
 AssyUID(i) = Parent.AssyUIDframe.frmAssyUID.fldAssyUID_i.value
Next

 
Take a look at the eval or execute statement.

Hope This Help
PH.
 
Thank you for the pointer, being new to a lot of this I'd never heard of them before, anyhow now it works, Cheers :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top