Are there hooks for backend?
Yael created the topic: Are there hooks for backend?
Forms backend - submissions page
In one of the forms we need at the backend on the submissions screen to replace the value of a hidden field we've put there and populate dynamically with some data from the database. We need the replacement on the table shown on the screen and in the csv file.
My question - is there a hook I can connect to and write my code that will replace the data in this single form?
(I didn't find any add-on that can do that on the add-ons list, but if there is I'd like to know and buy it).
Please Log in or Create an account to join the conversation.
6 years 10 months ago
Agapi G. replied the topic: Are there hooks for backend?
Hello Yael! Thanks for the question!
Here is the simplest way of making those changes. The data submitted with Form Maker is kept in wp_formmaker_submits table on MySQL database of your website. You can access the hidden field there with your query and change the value there.
Please note, that element_label parameter indicates the number of your form fields. After you make the changes, the hidden field will be automatically changed in Form Maker > Submissions page, and also in the exported file.
Thank you! Have a great day!
Kind regards,
Agapi G.
Web-Dorado team
Please Log in or Create an account to join the conversation.
6 years 10 months ago
Yael replied the topic: Are there hooks for backend?
Hello Apagi,
I'm not sure I understood. If I change it on the database, the change will be one time. I need the replacement regularly. The hidden field gets a number - 1, 2 , 3 or 4.
My client needs to see on the report "table" instead of 1, "chair" instead of 2, etc...
People are keep filling the form. I can't run a query on the database every time the form is being filled and a new record is coming.
For technical reasons I must use the numbers for the hidden field on the form and not the strings they represent. That's why I asked if there is a hook that I can connect to after the data is being pulled from the database and before it is presented on screen, so I can make the changes.
Alternatively, is there a way I can change the data after submission and before it is being written to the database?
Please Log in or Create an account to join the conversation.
6 years 10 months ago
Agapi G. replied the topic: Are there hooks for backend?
Hi Yael!
In this case we recommend you to use a Select Box field and hide it with CSS (if necessary). You can use Enable option's value option and set them to 1, 2, 3 or 4. I have attached a screenshot, where you will see this setting.
This has a big advantage, the plugin does not require customization this way. Please give it a try and let us know if this works.
Thanks! Have a great day!
Kind regards,
Agapi G.
Web-Dorado team
Please Log in or Create an account to join the conversation.
6 years 10 months ago
Yael replied the topic: Are there hooks for backend?
Thank you very much, but this suggestion will not work.
Anyway, I'll try getting the data I need with Ajax call. Hope it works...
Please Log in or Create an account to join the conversation.
6 years 10 months ago
Agapi G. replied the topic: Are there hooks for backend?
Hello Yael!
Please let us know in case you will need help with the code.
We'll be happy to assist!
Cheers!
Kind regards,
Agapi G.
Web-Dorado team
Please Log in or Create an account to join the conversation.
6 years 10 months ago
Yael replied the topic: Are there hooks for backend?
OK, problem solved with an ajax call when the form is loaded. Thank you.
Please Log in or Create an account to join the conversation.
6 years 10 months ago
Agapi G. replied the topic: Are there hooks for backend?
That's wonderful, Yael!
We are happy to know you have figured out a way to achieve the necessary functionality for your form! Please feel free to contact our team in case you will have further requests. We are always glad to hear from you!
Thank you! Have a nice weekend!
Kind regards,
Agapi G.
Web-Dorado team
Please Log in or Create an account to join the conversation.
6 years 10 months ago