Reply To: sending product variables

Home Forums Quform WordPress sending product variables Reply To: sending product variables

#37617
schmucki
Participant

Hi
What we are planning exactly is as follows.
We use a page template in WordPress. The template contains the basic structure of our site as an HTML framework to hook into via Javascript.
When loading the template page, a JS is used on the frontend side to fetch content via WordPress API, filter it and attach it to the HTML structure as a table. This dynamically generated content also includes buttons that open a popup containing the Quform form. Depending on which button is clicked, the Quform form is to receive data that is to be sent as an email in addition to standard fields like name, adress, etc.
So far I have tried to place the form in the popup via shortcode:

<div class=“quform-popup-content”><?php echo do_shortcode('[quform id=“14” name=“Contact form Product-Finder”]'); ?></div>

which is generated by the template on the server side and is set to display:none; until hitting the button. I then addressed a hidden field contained in the form via JS and reset the “value” property to:
<input type=“hidden” name=“quform_14_17” value=“XXX”>

However, when I submit the form, the hidden field is empty, so no data is transmitted.
So how can I transmit values to the already integrated form at runtime? Since PHP is generated on the server side, I can only include the form when the page is loaded, right?

I would be very happy to receive a suggestion for a suitable workflow.

Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy