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.
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 lang
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, lang
is set to all 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):
res+= "<form name=\"formularet\" action=right.html method="POST">"
foreach(languageOrder, string lang) {
res+= "<input type=hidden name=lang value=\""+lang+"\">\n"
"<input type=submit name=a2 value=\"Save\"> "
}
Any ideas on how to just pass the language for the button that was pressed?