• Resolved jamminjames

    (@jamminjames)


    I’d like to write to a hidden field in the database after a form has been submitted. I read this post about the subject, but I’m not clear on how to integrate the “solution” provided with the code this person was using.

    The solution returns $prepared_data, how is that then used with the code provided by the post writer at the above link?

    • This topic was modified 1 year, 1 month ago by jamminjames.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @jamminjames

    By default, this is not possible and this will be outside the scope of support to provide such a thing. For that, you’ll need to hire a developer to provide the required custom code for you. WordPress provides a jobs directory here https://jobs.wordpress.net/, if you need further advice about it, feel free to email [email protected].

    – Subject: ATTN: WPMU DEV support – wp.org
    – Link back to this thread for reference (https://ww.wp.xz.cn/support/topic/writing-to-fields-after-submission-using-api/)

    Kind Regards,
    Kris

    Thread Starter jamminjames

    (@jamminjames)

    I’m confused. You say, “By default, this is not possible,” but the link I gave is to another support thread here with an explanation of how to do it. I was only asking for some clarification. I don’t need a developer, as I am one. Since you folks explained it at the link, can’t you give me a little clarification? Thanks.

    Plugin Support Saurabh – WPMU DEV Support

    (@wpmudev-support7)

    Hello @jamminjames

    Hope you’re doing well today!

    Sorry for the confusion, If I am able to understand your requirement correctly, you are referring to the other thread, and specifically the reply – https://ww.wp.xz.cn/support/topic/submit-data-to-another-db/#post-16744321. If not, please let us know as there are multiple snippets involved in the discussion you’ve referred to.

    Further, based on what you are trying to achieve, you can try using the $prepared_data as below and see if that helps.

    Forminator_CForm_Front_Action::$prepared_data;
    
    // your query for DB

    This should help.

    Kind Regards,
    Saurabh

    Thread Starter jamminjames

    (@jamminjames)

    In the code provided at https://ww.wp.xz.cn/support/topic/submit-data-to-another-db/#post-16744321, what does $module_object refer to?

    Also, is there any Forminator API hook that can be used to update form data in the database?

    • This reply was modified 1 year, 1 month ago by jamminjames.
    Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @jamminjames,

    I hope this message finds you well.

    The $module_object refers to an instance of an internal class used by Forminator to manage the form that is currently being submitted. This object holds various properties of the form. It also provides methods that allow developers to interact with and manipulate the form during the submission process. By accessing $module_object, you can retrieve important form data or perform specific actions that are necessary for handling the form submission effectively.

    Can you please confirm if you are looking forward to updating the form data in the database, which has already been submitted? I am afraid, Formaintor does not have an API hook that can help with this.

    Please feel free to get back to us if you need any further clarification.

    Best Regards,
    Nebu John

    Thread Starter jamminjames

    (@jamminjames)

    Yes, I want to update form data which has already been submitted. So, no way to do that via the API — okay, that’s what I wanted to know. I’ll have to do it by more conventional means. Thank you.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Writing to hidden fields after submission using API’ is closed to new replies.