Skip to main content
added 510 characters in body
Source Link
Clive
  • 167.9k
  • 19
  • 303
  • 337

You have the #disabled property set on your submit element. Drupal's form API does not process the input for any element, including submit buttons, if the #disabled property is set on the server side.

If you're interested in the code behind this, the decisions are made in the _form_builder_handle_input_element() function in the includes/form.inc file of your Drupal installation.

If you want the submit button to be disabled by default for client-side purposes (i.e. you'll be enabling it through JS based on some action taken by the user) you would be better off setting the disabled attribute directly on the element, as Drupal pays no attention to this when processing the form:

$form['submit'] = array(
  '#type' => 'submit',
  '#value' => t('Submit'),
  '#attributes' => array(
    'style' => "padding: 0 10px;",
    'disabled' => 'disabled'
  )
);

You have the #disabled property set on your submit element. Drupal's form API does not process the input for any element, including submit buttons, if the #disabled property is set on the server side.

If you're interested in the code behind this, the decisions are made in the _form_builder_handle_input_element() function in the includes/form.inc file of your Drupal installation.

You have the #disabled property set on your submit element. Drupal's form API does not process the input for any element, including submit buttons, if the #disabled property is set on the server side.

If you're interested in the code behind this, the decisions are made in the _form_builder_handle_input_element() function in the includes/form.inc file of your Drupal installation.

If you want the submit button to be disabled by default for client-side purposes (i.e. you'll be enabling it through JS based on some action taken by the user) you would be better off setting the disabled attribute directly on the element, as Drupal pays no attention to this when processing the form:

$form['submit'] = array(
  '#type' => 'submit',
  '#value' => t('Submit'),
  '#attributes' => array(
    'style' => "padding: 0 10px;",
    'disabled' => 'disabled'
  )
);
Source Link
Clive
  • 167.9k
  • 19
  • 303
  • 337

You have the #disabled property set on your submit element. Drupal's form API does not process the input for any element, including submit buttons, if the #disabled property is set on the server side.

If you're interested in the code behind this, the decisions are made in the _form_builder_handle_input_element() function in the includes/form.inc file of your Drupal installation.