Objects are useful when handling CGI
arrays
. Ordinarily, if more than one argument value is
passed to an LXP document with the same argument name, the value of the last passed argument is used, and any preceding
values are ignored. However, by passing a CGI argument with a name ending in empty square brackets (e.g.,
<select name="test[]">), an LXP object will automatically have an array of values
assigned to an object bearing the name preceding the square brackets.
In other words, any argument passed from a CGI form whose name ends in square brackets (e.g.,
test[]) will be implicitly treated by LXP as an array of values. When such an argument is
passed to LXP by a submitted form, each separate value found for it is automatically set as a separate variable value in
memory, with an incrementing numeric value between the brackets following the object's name.
For example, if an HTML form passes an argument named test[] that has three values
set to its name, three variable values will be set for a test object. These values may be
referenced as test[0], test[1], and test[2], respectively.