Forum OpenACS Q&A: Re: How to manage arrays in ad_form?

Collapse
Posted by Rocael Hernández Rizzardini on
I think, more than array problem is an variable *name* problem, since is not used as array.

You are creating dynamic values for ad_form, then, to get the values of each input, first, you need to know the name of the dynamic input, then you can get the value (using [set $var_name]). Have a look on:
packages/acs-subsite/www/shared/parameters.tcl to see how this is handled.

So you need to know, how many bullets you have created, then in your for:
for {set i 1} {$i <= $j} {incr i} {
  #to get the value:
  set bullet_value [set $bullet.$i]
  if { ![empty_string_p $bullet_value ] } {
            lappend bullet_list $bullet_value
      }
}