I am doing something very similar to this, but using a MB custom table to save the data: https://metabox.io/how-to-create-a-contact-form-with-mb-frontend-submission/
I am displaying my form on the single pages of a CPT. I want to know which post the form was submitted from, so I am just hooking into
rwmb_frontend_after_process and setting
$reference_post_id = get_the_ID(); and then saving that value to the database using the
MetaBox\CustomTable\API::update feature. That way whenever I look at the new post that is created from the form submit, I know which post that submission came from.
This was working perfectly until I decided to turn on ajax for the frontend form. Looks like doing this is causing problems with getting the id of post that the form is on. Is there a way to do this while using ajax?
I already saw this thread, but it also seems to require turning ajax off. Also, I'm not working with relationships.