Drupal's Form API uses an ID field to identify each form. These IDs are usually automatically generated based on the function declaring the form and are therefore unique. Consequently, they can be used to identify specific forms either while altering the form using
In this recipe, we will look at ways to identify the Form ID of a form.
We will be using the Devel module to retrieve and display the form ID, and the Search module to simulate a situation where there is more than one form on a page. Additionally, we will be adding our code to the mysite module created earlier in this book. It is assumed that all these modules have been installed ...