8 – Ajax submission not working for same webform rendered multiple times on same page

I have a content type called “FAQ” with teaser type display views page(Around 30 contents). I have created an ajax webform and rendering the form under each teaser content to collect user’s feedback for the FAQ. When I submit the first webform it works fine. But when I try to submit other forms on the same page it just scrolls to the top of the page and shows the confirmation message on the first form.

I guess it is not working due to the same ajax wrapper ID being loaded for all the forms. Can someone please suggest the best option to render the same form multiple times?

enter image description here

Custom Submit Handler to Integrate Payment Gateway in a Webform

I would like users filling up a webform in my site to make a payment before the form is submitted. The form should be submitted if the payment is successful else an error message should be displayed.

Is a custom submit handler with the payment gateways code/api in submitForm() a good way go about doing this?

Thanks for your help

theming – How can I style the webform submissions table?

Using Drupal 9 and Webform, I’m unable to find the twig template used to output /contact/form/submissions. Is there a place in the documentation that lists the twig templates? I see there is a View created that looks like it has submissions, but disabling it doesn’t break the page. If there is a better way to style it, that could also work.

Retrieve Webform submission data from database

Here’s a little background on my project: I have 10 or so webforms let’s call them Forms A thru J which are for different departments of a college. I also, have 1 credit card processing form let’s call Form Z. I will be collecting information from a form like Form A specific to that departments needs and upon submission will redirect the user to Form Z to process a credit card transaction. I have created a webform handler to redirect the user from Forms A-J to Form Z and a handler to process the credit card transaction. In the redirect handler I am able to pass all of the information from Forms A-J to Form Z using the query string in the URL. I want to avoid this since there would be Personal Identifiable Information (PII) being passed through the URL.

I want to be able to retrieve the data submitted on say Form A from the database when Form Z is loading. I should be able to pass the webform node ID and submission ID to Form Z through the URL query string and use them to get the data from the database. I found these posts which give me an idea of how to retrieve the data from the database:

Programmatically update Webform Submission by sid

Load webform submission


What I can’t find is how do I get this to run when Form Z is loading. I’ve seen a couple of posts on hook_form_alter but those posts are using it in a different way from what I am trying to do so I don’t know it that’s the way I need to go.

Once I retrieve the data from the database I need to populate that data into I’m thinking some hidden webform fields on Form Z. I’d like to be able to fill billing address with the address submitted with the previous form upon request (checkbox or button). Also, I need to be able to have the data from the previous form available once Form Z submits so that I can send a custom email Confirmation depending on which form the information came from (i.e. Form A or B or J).

Being new to drupal development I’ve gotten some great assistance with this project from this site and I am very grateful to those who have been assisting me. 🙂

Is it possible to load a webform that is using a specific custom handler?

I have a custom handler for one of our webforms, it may be re-used for other webforms. It integrates with a 3rd party API and sends the response back to Drupal.
I have to save the submissions to handle the response.
I`m wondering if its possible to load all webforms which are using this custom handler?

My goal is delete submissions of those webforms when they are older than a certain time.

theming – How can I access webform submission values from webform-confirmation.html.twig

I have a webform with Inline confirmation, AJAX enabled and saving of submissions disabled.

Is it possible to access the submitted values from the webform-confirmation.html.twig template?

I know that I can do this by adding token values to the Confirmation message in the WebForm UI. But I prefer to solve this by modifying the template.

My motivation for doing this is that I need to add a javascript snippet after the user has submitted the form. And I want to do it at the template level because I have a larger number of forms where I need to add the javascript snippet.



How to plot a graph or Chart on the Confirmation message (webform, Drupal 8)

How to plot a graph on the Confirmation message; in Webfowm and Drupal 8.
I searched a lot, but did not find anything useful; But, as a summary, these results:

  1. There are several Modules involved in graphing, the most famous one is: charts
  2. There is a programming solution (9 years ago), but I don’t think it works. Because the site will contain dozens of questionnaires; drawing Charts should be easy, something similar to Twing or Only in Confirmation message TextBox area.
  3. images files can be displayed if uploaded to the site via the questionnaire in this way (from this):
<img src="https://drupal.stackexchange.com/(submission:values:image_key)"/>
  1. There are previous attempts at Drupal 7, I do not know how it was work. Webform Charts

In the end; I could not find any solution. Does any one have any idea?

How do i get all user emails with a special flag (in example member of a Group) for a webform?

i need a Webform that send a email to group of users, which have the same interests. I use “Groups” (not organic groups, because of Drupal9) for that, so the users can decide themself to join or not.

With Webform it is possible to mail to a role of users, but not for groups. Is there a little chance, that i can select only the email-adresses from users with a special flag, like an extra field, or membership in a group ?