• Hello, I want to connect the result of form, to pass it to an API, and then display the result of the API. In order to do this, I have a 3 steps plan :

    1. Create a form with WPforms and note its ID
    2. Write the php code with the snippet plugin code that gather WP form data, make an api call and display it
    3. Instantiate the WPform on my page, and paste in the following block the snippet code so that it is evaluated

    First, for testing purpose I only want to display the result of the form so I wrote the following code :

    function be_crm_display_raw_form_data( $fields, $entry, $form_data, $entry_id ) {
    echo "<pre>";
    print_r( $fields );
    echo "</pre>";
    }
    add_action( 'wpforms_process_complete', 'be_crm_display_raw_form_data', 10, 4 );

    But after filling the form on preview page and hitting submit, nothing shows up. Can you please point to me what I am doing wrong.

    Thanks in advance for your answer

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Shawon Chowdhury

    (@shawon001)

    Hi @asamaras ,

    Thanks for reaching out!

    The code should work however printing values on the page with this action will affect AJAX form submission.

    Could you please disable AJAX form submission for this form and see how it goes?

    Thanks ??

    Thread Starter asamaras

    (@asamaras)

    Thank you for your answer,

    I disabled AJAX form submission on the relevant form, unfortunately it stills does not show any result.

    Plugin Support Shawon Chowdhury

    (@shawon001)

    Hello @asamaras ,

    That’s unfortunate! I just did a test on my end and created a screencast for you here.

    As you can see, it’s working fine without any issues when the AJAX submission is disabled.
    Please try again after clearing the browser’s cache, and see if that helps.

    Thanks ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.