HTML input type="hidden" is not binding the right values in foreach loop
<p>I'm programming in a language called pike, which is an interpreted, object-oriented, dynamic programming language with a syntax similar to C. The pike code is used to generate HTML and javascript.</p>

<p>Now to my problem. I have a form called formularet and a submit button for each language. What I want to do is pass the language <code>lang</code> as an argument when the form is submitted. I thought this could be achieved by using a hidden input, but whenever any submit button is pressed, <code>lang</code> is set to <em>all</em> the languages instead of just the one which button was pressed. This is basically the relevent code (languageOrder is an array with all the languages):</p>

<pre><code>res+= "&lt;form name=\"formularet\" action=right.html method="POST"&gt;"

foreach(languageOrder, string lang) {
    res+= "&lt;input type=hidden name=lang value=\""+lang+"\"&gt;\n"
      "&lt;input type=submit name=a2 value=\"Save\"&gt;&amp;nbsp;"
}
</code></pre>

<p>Any ideas on how to just pass the language for the button that was pressed?</p>