<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Nancy,<br>
<br>
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.<br>
<br>
Hans<br>
<br>
nan wich wrote:
<blockquote cite="mid:7010.7041.qm@web180314.mail.gq1.yahoo.com"
type="cite">
<style type="text/css"><!-- DIV {margin:0px;} --></style>
<div
style="font-family: Courier New,courier,monaco,monospace,sans-serif; font-size: 12pt;">
<div>In Drupal, I recommend staying away from hidden values as they
actually do allow for a miniscule possibility of hacking. Instead use <font
style="background-color: rgb(225, 196, 168);">'#type' => 'value'</font>
which will not present on the rendered form. I have never had any
trouble with altering it in multistep forms.<br>
</div>
<p><font color="#ff007f"
face="bookman old style, new york, times, serif" size="4"><em><strong>Nancy
E. Wichmann, PMP</strong></em></font></p>
<p><font face="arial, helvetica, sans-serif">Injustice anywhere is a
threat to justice everywhere. -- Dr. Martin L. King, Jr.</font></p>
<div><br>
</div>
<div
style="font-size: 12pt; font-family: Courier New,courier,monaco,monospace,sans-serif;"><br>
<div style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"><font
face="Tahoma" size="2">
<hr size="1"><b><span style="font-weight: bold;">From:</span></b>
Hans Langouche <a class="moz-txt-link-rfc2396E" href="mailto:hans.langouche@gmail.com"><hans.langouche@gmail.com></a><br>
<b><span style="font-weight: bold;">To:</span></b>
<a class="moz-txt-link-abbreviated" href="mailto:development@drupal.org">development@drupal.org</a><br>
<b><span style="font-weight: bold;">Sent:</span></b> Sat, March 13,
2010 8:53:26 AM<br>
<b><span style="font-weight: bold;">Subject:</span></b> [development]
form_api: same form called multiple times, wrong form_state values<br>
</font><br>
Hi all,<br>
<br>
I have a small admin form (2 buttons and a hidden value) that is
repeated multiple times (each time the value is different).<br>
<br>
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.<br>
<br>
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 ?<br>
<br>
Tnx,<br>
<br>
HnLn<br>
</div>
</div>
</div>
</blockquote>
</body>
</html>