Skip to main content
1 of 2
Shabir A.
  • 2.9k
  • 13
  • 25

You can use form_state instead of form in your submit handler

function module_simplenews_unsubscribe($form, &$form_state) {

  if ($form_state['values']['checkbox'] == 0) {
    drupal_set_message(t("You are checked"));
  }
 if ($form_state['values']['checkbox'] == 1) {

    drupal_set_message(t("You are unchecked"));
  }

Use debug tools for proper index of form_state for checkbox.

Shabir A.
  • 2.9k
  • 13
  • 25