Hi Nancy,

I started with using 'value', but also the same result (fyi, it's not a multi step form but the same form multiple times), switched to hidden so I can grab the values from $_POST as form_state['values'] returns the same data for every form.

Hans

nan wich wrote:
In Drupal, I recommend staying away from hidden values as they actually do allow for a miniscule possibility of hacking. Instead use '#type' => 'value' which will not present on the rendered form. I have never had any trouble with altering it in multistep forms.
 

Nancy E. Wichmann, PMP

Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.




From: Hans Langouche <hans.langouche@gmail.com>
To: development@drupal.org
Sent: Sat, March 13, 2010 8:53:26 AM
Subject: [development] form_api: same form called multiple times, wrong form_state values

Hi all,

I have a small admin form (2 buttons and a hidden value) that is repeated multiple times (each time the value is different).

Now whenever I access $form_state['values'] from the submit function, the hidden value always returns the data from the first form.  When I print out $_POST directly I do get the correct data.

I've been searching this and it seems this is because the form_state is cached.  I couldn't find any workaround though, so for the moment working with $_POST.  Anyone know the correct way to do this ?

Tnx,

HnLn