Questions tagged as ['webforms']

Is it possible to see the date a webform was created?
We use webforms extensively and sometimes they have very similar names, we want to be able to see when a webform was created to be able to determine which is the correct one.
This doesn't appear to be in the webform object nor in any db tables.
I have a webform with a managed file field. I need to send that field in the email as well.
I have added the submission:values
field, but it doesn't add spaces between the filename and the file size.
I need to add a space between the file name and its size. How can I achieve this?
I have a webform in Drupal 8 that is submitted with the count of each answer from another webform survey form filled out earlier.
So form A is filled out through the month, then form B is submitted at the end of the month with the number of each answer from form A.
I'm trying to figure out the best way to add the default value to the report form B.
- hook_form_alter,
- .theme function and computed twi ...

We have a custom Drush command implemented using the following code.
class JobApplicationExportCommands extends DrushCommands {
/**
* Exports Dorea Job Applications since the last run to csv
*
* @command dummy:job-application-export
* @aliases duje
*/
public function drush_dummy_export() {
$applicationWebformIds = Drupal::entityQuery('webform')
->condition('category', ...
I'm using Drupal 8 together with the Webform module.
Is there a way to transfer the value of a field in a specific content type to a webform?
This is the situation:
There's a content type called 'Vacature' where you create the specific content (vacancies).
When adding a new vacancy I provide a field called 'vacaturecode' and a dropdown where you select the application webform that will be used to app ...

In the webform e-mail handler configuration I can see that webform
twig variable is available. I looked to the context with xDebug and it looks like I should be able to print e-mail address of the recipient with in the mail body. But it doesn't work, the body is empty. Do you know why and how can I fix this?
{{ webform.handlers.e_mail.settings.to_mail }}
Edit: I also tried to use token like this: ...
Is there a non-code way to show how many questions are left in a multipage webform module? For 508 reasons we (at work) use multiple pages for forms. Some pages have 2 questions while other have have a bunch. Is there any way to let the user know how many questions are left?
I guess the count would be nice on a per-field basis, but that might be a lot to accomplish. Even a count of what's left af ...

The address feilds are not populating from the querystring.
This page is also showing a date at top of form that shouldnt be there.
I have a Drupal 7 webform when I need to dynamically populate a select field's options. I'm currently using hook_form_alter() and setting the values on the like so:
<?php
$form['submitted']['left']['select_field_name']['#options'] = $new_options;
</php>
This works for displaying the new options on the webform creation but the values are not saved with the form.
I know there is a hook_webform_se ...
The scenario is a template (tpl) file outputting a list of contact forms where each one is unique to a term ID in it section on the page. I need to generate a custom options list per printed Webform block using a tid passed from the section it's in in the template. So far I don't see any way to do this.
sample.tpl.php
<?php
$block = module_invoke('webform', 'block_view', 'my-block-3581');
pri ...

The webform provides the [webform_submission:values] but when sent through emails, the layout is not very readable. All values are not separated for readablitity where I can use paragraph tags to separate it.
I am assuming something like the below would be the way to do this but I cant find the right syntax to make it work.
I would like something like that I can wrap html around to create readability. ...
Maybe someone knows why when you change the name of the button, its class changes from btn-primary to btn-default. btn-primary only if there is a submit in the button name (Without spaces before or after).
I am trying to use hook_form_alter()
to change the details of the CiviCRM Payment Processor for specific users (to change from live mode to test mode).
On Drupal 7 it's in $form['submitted']
when Page 2 is rendered. Many items are already there on Page 1, but this is not.
Are these somewhere else, or do I have to use a different mechanism, in Drupal 9?
I have a webform (contact_info) which is attached to a paragraph's field (field_contact_info). The paragraph has other fields as well.
I implemented hook_form_alter()
to change some attributes inside the webform's form.
Is there any way to access the values of other paragraph fields value in hook_form_alter()
?
I can pass them inside the webform object, but those aren't available in hook_form_alter()

I want to download the results of certain webforms. I currently download them as CSV file by navigating to the download tab within the Drupal UI.
Is it possible to programmatically download the results?
I am using Drupal 8.9.17 and Webform 6.0.4.
I have created a webform (registering for an event) that I am attaching to nodes (events). On the webform, I have checked "Allow users to update a submission using a secure token." And I have limited users to 1 submission per source entity.
All is good so far, but I would like the "Per user submission limit message" to say "You have already registered for ...
Is there a way with Webform 6 to create custom element plugins that do not have any user-facing options?
For example, creating a select element that is usable in webforms, but its option list comes from a remote API - therefore does not need the editors to enter values in the UI?
This might be a basic question, but I'm trying to implement WebformMapping to a webform handler to display all the webform fields and map them to a 3rd party API on the configuration form.
Making something like this.
After some digging, I found these two threats:

The way to associate a webform with all content of a given type is to use the Webform field, and then set the default value (as far as i can tell). A bit of a problem when you already have hundreds of pieces of that content. Field Defaults saves the day— except that it does not bring in the settings for the Webform field, which is essential if you are passing a value from the content to the webform ...

I have a very long form. I would like to use the simple [submission:values] token in the email, but I'm hoping there is a way to add something that will leave out all the extraneous information like field set labels and descriptions.

I have configured entity_print with webform for D8 and can download a submission as pdf from the submission view.
Now I tried to let anonymous users fill out a form and added a link to the pdf on the confirmation page. I checked the show own submissions for guests on the permission page of that webform.
But when I try to access the pdf with the submited data I get a permission denied message.
http://m ...
I'm attempting to build a webform (Webform 8.x, Drupal 8) that requires the ability for a user to submit the form multiple times.
To simplify the process for users, I'd like to set up some form fields to:
- be empty by on their first visit to the form
- for subsequent renders of the form, some form fields should be prepopulated with submissions from the previous submission
Is there a way to achieve this ...
I have this webform with composite field where I add a file and a field where I add a number.
What I wish is using the token, to rename the file with number inputed in the number field. But the thing is I have a composite with multiple ilimited values and I can only do it if I declare a delta number as the following token: [webform_submission:values:element_key:delta:sub_element_key]
How can I do ...
We require site administrators to create new webforms with the machine name beginning with site_
. (This is because config ignore is set to ignore webform.webform.site_*
for user generated forms while other forms are part of config) How do you validate and set the webform machine name to begin with this prefix value?
How to change order (weight) of webform elements in conditional logic based on the visibility of other elements?
My webform example, six fields:
Open field A? (Checkbox yes/no)
Field A is hidden (textfield, hidden because current-page-node-field-a is null)
Open field B? (Checkbox yes/no)
Field B is hidden (textfield, hidden because current-page-node-field-b is null)
Open field C? (Checkbox ye ...

I made a custom handler for one of my webform to call a service when the form is submitted. Here is my code. It is working when the service return a response with status code = 200 but I cannot find a way to notify the view when an error is raised by the webservice. I would like to show a modal with an error message but cannot find how to do this.
class CRMWebformHandler extends WebformHandlerBase ...
I need to update webform module in my live site, I noticed the warning with doing that with the user Interface so I want to update the files manually, ( because we don't use drush ), Can I get directions for doing this update? again since the site is live and this is our first Drupal site I want to make sure from not breaking the site or having any issues!
also, I have the files in Cpanel so from ...
Is there a way where we could change the date format of the form submission? For Example in the Webform I have created there's no date picker in it. But when the web form is submitted by the user by default it comes in this format Sun mm/dd/yyyy but I want it dd/mm/yyyy (It is stored in Structure ->Websforms -->Submissions)How can i change the date format once the webform is submitted?
How can you send the submitted information in a webform to a 3rd party API?
I have read this: https://www.drupal.org/docs/8/modules/webform/webform-cookbook/how-to-programmatically-create-and-update-a-submission
But it looks this recipe is more about updating a submission rather that doing requests.
Any help?
Note:
I realized I can use handlers for submission, but need to use a refresh authenticat ...

I'm trying to re-use the output from a heavily customized field formatter as <select><option>
text in a Webform. I managed to re-use field display, but it has the side-effect of switching the theme used for rendering.
Below is a simplified code, the lines $dateRenderArray = ...
and $dateHtml = ...
are original and cause the problem:
function mymodule_webform_options_alter(array &$optio ...