My confirm form should consists part of node form but with disabled fields. I mean after I submit node form I rebuild it and append confirm form in hook_form_alter()(Before it I change submit callback and set 'reduild' flag in form_state in it).

But this form not containing filled values. I guess this is because I make rebuild but as I know there is no other way to display confirm form. So the question is how to do it? How to fill values filled on previous step?

First phase submit callback:

function mymodule_content_confirm_form_submit($form, &$form_state) {
  $form_state['storage']['confirm'] = 'save';
  $form_state['storage']['values'] = $form_state['values'];
  $form_state['rebuild'] = TRUE;

Form alter the part where confirm form appends:

  $show_confirm_form = isset($form_state['storage']['confirm']);
  if ($show_confirm_form) {
    // We need this form for panels and we can't remove it so we just hide.
    foreach (element_children($form) as $id) {
      $element = &$form[$id];
      if (!empty($element['#type']) && in_array($element['#type'], array('hidden', 'value'))) {
      $element['#disabled'] = TRUE;
    $message = t('Are you sure you want to save all these changes?');

    $form = confirm_form($form, t('Levels & Content'), current_path(), $message, t('Confirm'), t('Cancel'));
    $form['actions']['cancel']['#href'] = current_path();
    $form['actions']['cancel']['#attributes']['class'][] = 'button';
    $form['actions']['cancel']['#options']['path'] = current_path();
    $form['actions']['cancel']['#options']['query'] = $destination;

    $form['actions']['submit']['#submit'] = array('mobitek_custom_content_node_form_insert_values_submit', 'node_form_submit');
  • Are you able to see the form values in your $form_state['values'] array? Commented Nov 26, 2014 at 14:35
  • Yes, I am. But in form array they are missing.
    – FriOne
    Commented Nov 27, 2014 at 5:45

1 Answer 1


This is my dirty solution of the problem, I use $form_state['complte form'] instead $form:

$refill_fields = array(
foreach ($refill_fields as $refill_field) {
  $form_state['complete form'][$refill_field] = $form[$refill_field];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.