Hi everybody !

I use webform with multistep for a quiz. I want to add a "skip" button (equivalent to the submit/next button in the bottom of the form) above the form so that people can go directly to the next question without having to scroll down the page like that :

Skip this question
My form
< Previous | Next > 

I succeeded to add an another submit button (check code below). But when I click on this button it returns to the previous step instead of going to the next step ... I don't understand why .. And I can not put it above the form.

function mytemplate_form_alter(&$form, &$form_state, $form_id) {
  switch ($form_id) {
  case 'webform_client_form_13':
    $form['submit'] = array(
      '#type' => 'submit',
      '#value' => t('skip'),
    );
    break;
  }
}

Have you got an idea for help me ?

Thanks you for advance

PS : sorry for my bad english

Comments

pierre521’s picture

Issue summary: View changes
DanChadwick’s picture

Category: Feature request » Support request
Status: Active » Fixed

You can probably use hook_form_webform_client_form_alter as you suggested to make another "Next" button, but placed at the top of the form. You'd have to read the code to see what issues there might be. Without reading the code, I'm not sure how the Next button is identified, and whether it has its own submit handler. The safest way would be to copy the existing button, changing it as desired.

Beyond that, we don't supply custom programming support in the webform issue queue. Try the forums or IRC. Good luck.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

pal4life’s picture

Not entirely sure but maybe Webform_steps module may help you with that.
https://www.drupal.org/project/webform_steps

DanChadwick’s picture

@pal4life -- thank you for your help in the issue queue! It is very much appreciated.