Focal Point
Dynamic number of form elements

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8881068331

June 13, 2005, 08:58 PM
anush
Dynamic number of form elements
Here's the scenario...

I am going to be displaying a 2 x n matrix of textboxes on-screen and I want the users to be able to add/delete rows without having to post/refresh the screen (using DHTML); i.e. if I initially have a 2 x 5 matrix and a row is deleted, it becomes a 2 x 4 matrix.

The problem...

How would I be able to figure out how many rows are going to be passed back to the fex and how can I access those values? Assumming I call them:

PARM11, PARM12
PARM21, PARM22
PARM31, PARM32
...

I know how to dynamically assign the parameter names on the HTML side, but how do I dynamically determine if PARM 32 even exists?
June 13, 2005, 09:25 PM
TexasStingray
If it was me I would give the all the same name. Then in the fex you have multiple variable with the same name but with a counter on the end. to access them you can use &VARNAME.&COUNTER.EXIST and see if the exist. &VARNAME.&COUNTER where counter EQ 0 tells you how many there are.
June 15, 2005, 08:49 PM
anush
Works great! Thanks for the tip.