diff --git a/includes/ingest.form.inc b/includes/ingest.form.inc index 6c802f44..c83b140c 100644 --- a/includes/ingest.form.inc +++ b/includes/ingest.form.inc @@ -499,6 +499,14 @@ function islandora_ingest_form_stepify(array $form, array &$form_state, array $s ); $form['prev'] = $first_form_step ? NULL : islandora_ingest_form_previous_button($form_state); $form['next'] = $last_form_step ? islandora_ingest_form_ingest_button($form_state) : islandora_ingest_form_next_button($form_state); + // Duplicate next button and hide it at the top of the form so that the form + // always triggers "next" if the user submits the form with the enter key. + if (!is_null($form['prev'])) { + $form['hidden_next'] = $form['next']; + $form['hidden_next']['#weight'] = -99; + $form['hidden_next']['#prefix'] = '
'; + $form['hidden_next']['#suffix'] = '
'; + } // Allow for a hook_form_FORM_ID_alter(). drupal_alter(array('form_' . $step['form_id'], 'form'), $form, $form_state, $step['form_id']); return $form;