I have two forms on the same page, both called with drupal_get_form('some_form_name', $product_id);
. The $product_id
variable is used to fill in a hidden
input. (The code is in a foreach
, the $product_id
variable is different for every form.)
In the generated HTML, the forms are correctly built. Both have different IDs, and both hidden fields have the correct value.
However, in the submit function of this forms, with the following code:
function some_form_name_submit($form, &$form_state) {
dsm($form_state['values']['product_id']);
}
The product id is always the same. The first generated form's product id.
After some research, I found out that the hidden input form_id
is the same in both forms. Looking into that.
Is there a way to solve this?