Drupal

Drupal 5: How to process multiple instances of the same form on the same page

Tags: |

This problem recently presented itself to me while working on a Drupal site which made heavy use of a non-ajaxed tabbed interface. With Drupal 5’s form API, form handling got a lot more agile, but the solution to this particular problem was not easy to find, though the API was able to solve my problem with a little digging.

The problem ?

Given a page with multiple instances of the same form (which use the same form id), your form submit() function may not receive the anticipated set of form values for the form the user has submitted. The values you get may not be from the form attached to the submit button the user clicked, but values from a different form with different values which is using the same form id.


Syndicate content