1

I have a ninja form that redirects to a thank you page. I am trying to process the values submitted in the form to display different content on the thank you page. I have achieved this in Ninja Forms 2 using the following code, but it doesn't work in Ninja Forms 3. And I can't work out what to do with their example code given here http://docs.ninjaforms.com/customer/portal/articles/1981022-actions-methods-processing-ninja_forms_post_process.

Here is what I have successfully used in Ninja forms 2.

$form_id ='11';
$user_ID = get_current_user_id();

$args = array(
'form_id'   => $form_id,
'user_id'   => $user_ID,

);
// This will return an array of sub objects.
$subs = Ninja_Forms()->subs()->get( $args );


    $counter=1;

foreach ( $subs as $sub ) {
            if($counter==1){

$form_id = $sub->form_id;
$user_id = $sub->user_id;
// Returns an array of [field_id] => [user_value] pairs
$all_fields = $sub->get_all_fields();

 print_r($all_fields);

echo $sub->get_field( 34 );
            } 
            $counter++;

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.