Get fields after submission

Support MB Frontend Submission Get fields after submissionResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36838
    vacdkvacdk
    Participant

    Hi

    I'm trying to display the values of the fields and fields in a group I have entered in the form after a submission on the page.

    But it's not working.

    field group name: ticket-addon
    text id: text_xz6kbjy3pgr
    Group id: group_tapgyiu2mz
    Groud select id: select_lx9zylbpk6b

    add_action(
        "rwmb_frontend_after_process",
        function ($config, $post_id) {
            if ("ticket-addon" === $config["id"]) {
    
                echo rwmb_get_value( 'text_xz6kbjy3pgr' );
    
                $group_values = rwmb_meta( 'group_tapgyiu2mz' );
                if ( ! empty( $group_values ) ) {
                    foreach ( $group_values as $group_value ) {
                        $value = isset( $group_value[ 'select_lx9zylbpk6b' ] ) ? $group_value[ 'select_lx9zylbpk6b' ] : '';
                        echo $value; // Display sub-field value
                    }
                }
    
                die();
            }
        },
        10,
        2
    );
    #36839
    vacdkvacdk
    Participant

    So i figured it out by define the post_id

    rwmb_meta( 'my_field_id', '', $post_id );

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