Amazon Store has to do this:<br><br><span style="font-family: courier new,monospace;">function amazon_store_forms($form_id) {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> $args = func_get_args();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> $forms = array();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> if (strpos($form_id, 'amazon_store_addcart_form') === 0) {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> $forms[$form_id] = array(</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> 'callback' => 'amazon_store_addcart_form',</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> 'callback arguments' => $args[1],</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> );</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> if (strpos($form_id, '_amazon_store_cart_quantity_form') === 0) {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> $forms[$form_id] = array(</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> 'callback' => '_amazon_store_cart_quantity_form',</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> 'callback arguments' => $args[1],</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> );</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> return $forms;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">}</span><br><br><br>Then instead of just drupal_get_form('form_id'), you have to do drupal_get_form('form_id_plus_key'), if I remember right.<br><br>-Randy<br>
<br><br><div class="gmail_quote">On Sun, Mar 14, 2010 at 4:46 PM, Greg Knaddison <span dir="ltr"><<a href="mailto:Greg@growingventuresolutions.com">Greg@growingventuresolutions.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">On Sat, Mar 13, 2010 at 6:53 AM, Hans Langouche<br>
<<a href="mailto:hans.langouche@gmail.com">hans.langouche@gmail.com</a>> wrote:<br>
> I have a small admin form (2 buttons and a hidden value) that is repeated<br>
> multiple times (each time the value is different).<br>
><br>
> Now whenever I access $form_state['values'] from the submit function, the<br>
> hidden value always returns the data from the first form. When I print out<br>
> $_POST directly I do get the correct data.<br>
><br>
> I've been searching this and it seems this is because the form_state is<br>
> cached. I couldn't find any workaround though, so for the moment working<br>
> with $_POST. Anyone know the correct way to do this ?<br>
<br>
</div></div>I ran into this a while ago myself. You have to do a little trickery<br>
with the form_id value so that each form on the page has a unique ID.<br>
If the forms are for users then maybe the UID will work. If they are<br>
for node teasers maybe the node ID. Then you create a hook_forms value<br>
that gets called and resets the callback to be a specific general<br>
function.<br>
<br>
See <a href="http://api.drupal.org/api/function/hook_forms" target="_blank">http://api.drupal.org/api/function/hook_forms</a> and perhaps some of<br>
the modules which use it like fivestar.module and<br>
notifications_ui.module (I think that one does...one of the<br>
notifications/messaging modules does).<br>
<br>
Please ask if you need more advice - it's a tricky problem to resolve<br>
that cost me more time than I'd like to admit.<br>
<br>
Regards,<br>
Greg<br>
<font color="#888888"><br>
--<br>
Greg Knaddison | 303-800-5623 | <a href="http://growingventuresolutions.com" target="_blank">http://growingventuresolutions.com</a><br>
Mastering Drupal - <a href="http://www.masteringdrupal.com" target="_blank">http://www.masteringdrupal.com</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Randy Fay<br>Drupal Development, troubleshooting, and debugging<br><a href="mailto:randy@randyfay.com">randy@randyfay.com</a><br>+1 970.462.7450<br><br>