Button in multiform make it go to different steps Well I have an issue with a multiform. I have use the example files in
https://www.drupal.org/project/ms_ajax_form_example as a base for what I have to do in a Drupal 8 site.

Everything runs perfect, but I need in the first step to validate if the user selects a radio button, and depending in the selection of the radio make the user go to different steps in the form.

So I have my radio button in my first step:

$form['inquiry_type'] = array(
        '#type' =&gt; 'radios',
        '#title' =&gt; t('Is your inquiry regarding Parcels or Mail?'),
        '#default_value' =&gt; 0,
        '#options' =&gt; array(
            0 =&gt; t('Mail'),
            1 =&gt; t('Parcels'),
        ),
    );


The pre selected value of the radio is Mail, if the user leaves it like that the code will take him to the step number 2. But if the user selects Parcels the code should take him to step 3.

Here is how the instance of the class of the next button is done in the same class.

public function getButtons() {
    return [
      new StepOneNextButton(),
    ];
  }


And the build function in the StepOneNextButton class.

public function build() {
    return [
      '#type' =&gt; 'submit',
      '#value' =&gt; t('Next'),
      '#goto_step' =&gt; StepsEnum::STEP_TWO,
    ];
  }


I'm really new to Drupal and all of this has been an interesting journey. But I'm not sure how to evaluate the selection of the radio before the user clicks the button. 

Hoping you guys can give me some insights of how this should be done.
This could be done with jQuery, like this:

$('#SUBMIT-ID').click(function () {
  $('.step-1-wrapper').addClass('hidden');
  $('.step-2-wrapper').removeClass('hidden');
});


Then you can show both steps from the beginning, and then hide them.

You also need to create a global css rule that makes a display none, on all hidden classes