Webform alter with ajax submit callback - field values are empty in callback At this point I'm doubting if I'm doing it the right way, but I'm struggling with an issue:
I'm adding an Ajax callback to the form alter of a specific form:
function mymodulename_form_alter(&amp;$form, &amp;$form_state, $form_id) {
if ($form_id == 'webform_submission_matching_node_218_add_form') {
    $form['actions']['submit']['#ajax'] = array(
        'callback' =&gt; 'matching_api_call',
        //'event' =&gt; 'click',
        'effect' =&gt; 'fade',
        'speed' =&gt; 500,
        'wrapper' =&gt; 'block-matchingblock',
        'progress' =&gt; [
            'type' =&gt; 'throbber',
            'message' =&gt; t('Matching...'),
        ]);
    }
}

The callback works fine but when I call $form_state-&gt;getValues(), I get an array with all my fields but they are simply empty or 0.
My callback function:
function matching_api_call(&amp;$form, \Drupal\Core\Form\FormStateInterface $form_state) {
    // ajax debug
    $response = new AjaxResponse();
    $selector = '#block-matchingblock';
    $content = print_r($form_state-&gt;getValues(), true);
    $settings = [];
    
    $response-&gt;addCommand(new HtmlCommand($selector, $content, $settings));
    return $response;
}

My output:
Array(
    [field1] =&gt;
    [field2] =&gt;
    [field3] =&gt; 0
    [field4] =&gt; 0
    [submit] =&gt; Match
    [form_build_id] =&gt; {formbuildid}
    [form_token] =&gt; {formtoken}
    [form_id] =&gt; {form_id}
    [op] =&gt; Match
)

The entry is added in the backend so it does get submitted. Should I do something else because I'm using Ajax here?
Thanks in advance.
Someone guided me in the right direction. My Webform Confirmation setting was set to 'None'. After setting it to 'Inline', calling $form_state-&gt;getValues() finally returns the form values.