Drupal form API

Drupal 6: finding out which button is clicked when using a image_button element

When using multiple image_button elements in a form, there's no easy way to found out which one was clicked. This page contains a solution which allows you to identify the clicked image_button.

Recently I was building a module which showed a rather complex form. The form contained a mix of submit button and image_button elements.

In the submit handler I wrote some code to discover which button was clicked.

I made it work in the following case:

Tags: 

Subscribe to RSS - Drupal form API