Two forms on the same page - both submit the same
Found the solution. The problem was that the forms had the same form_id -- some_form_name, the string passed to drupal_get_form().

I generated the string with something like drupal_get_form('some_form_name_' . $product_id); instead of passing as second argument.

However, that means I would have to define a function for each product id. To avoid this, I implemented hook_forms(), so that each form id starting with some_form_name_ would use the same callback to generate the form:

function mymodule_forms($form_id) {
    if (preg_match('/^some_form_name_\d+$/', $form_id)) {
        return array(
            $form_id =&gt; array(
                'callback' =&gt; 'some_form_name',
            ),
        );
    }
}


This way, even though each form has a different form_id, they all use the some_form_name function to generate the form.

And no problem left.