Questions tagged as ['webforms']

One of the modules used for surveys, contests, personalized contact forms, or petitions is the Webform module.
Score: 0
Webform created date
hu flag

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.

Score: 0
Usman Manzoor avatar
Email formatting for a file field?
pk flag

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?

Score: 0
Don Pickerel avatar
Give webform text field computed value
de flag

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.

  1. hook_form_alter,
  2. .theme function and computed twi ...
Score: 0
Calling setExposedInput() from a Drush command doesn't have any effect
ve flag

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', ...
Score: 0
Tom C avatar
How to address the field value in a node from a webform
ru flag

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 ...

Score: 0
How can I print recipient mail address in webform email handler body with twig?
us flag

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: ...

Score: 0
blur avatar
Can I display how many questions left in a form from the Webform module?
bn flag

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 ...

Score: 0
quantumized avatar
How to add custom option value to select field in Webform and have them save with the submission?
ng flag

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:

 $form['submitted']['left']['select_field_name']['#options'] = $new_options;

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 ...

Score: 0
quantumized avatar
Is there a way to pass a value to a hidden field to multiple blocks printed from a template file?
ng flag

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.


   $block = module_invoke('webform', 'block_view', 'my-block-3581');
   pri ...
Score: -1
Web Form Submission customizations of Email Handler
ng flag

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.  ...

Score: 1
Павел Герасюта avatar
Botton webform change bootstrap class
br flag

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).

Score: 1
maynardsmith avatar
How do I use a hook to modify CiviCRM payment processor details in Webform?
jp flag

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?

Score: 0
Md. Shafiq Hossain avatar
How to access paragraph fields from a webform's form?
cn flag

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()

Score: -1
How can I programmatically download webform results?
cn flag

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?

Score: 1
kosher avatar
Allowing users to edit their webform submission
cd flag

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  ...

Score: 0
Kevin avatar
Provide custom Webform element with no user-facing options?
in flag

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?

Score: 0
Renato Francia avatar
WebformMapping Element implementation in webform handler
id flag

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.

enter image description here

After some digging, I found these two threats:

Score: 0
How to associated a webform with all content of a given type— retroactively?
cn flag

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  ...

Score: 0
Is there a way to strip field set and description from [submission:values] in the emails tab?
dj flag

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.

Score: 0
Let anonymous user download pdf off his own webform submission
ng flag

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 ...

Score: 0
scaffolding avatar
Updated: Webform tokens present user-submitted data for form fields
es flag

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  ...

Score: 0
Thiery avatar
How to get a delta value from a composite with ilimited values?
vn flag

I have this webform with composite field where I add a file and a field where I add a number. print

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  ...

Score: 1
shelane avatar
How can I enforce a default machine name prefix?
cn flag

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?

Score: 0
kazah avatar
How to change the display order of webform elements (conditional logic)?
aq flag

How to change order (weight) of webform elements in conditional logic based on the visibility of other elements?

My webform example, six fields:

  1. Open field A? (Checkbox yes/no)

  2. Field A is hidden (textfield, hidden because current-page-node-field-a is null)

  3. Open field B? (Checkbox yes/no)

  4. Field B is hidden (textfield, hidden because current-page-node-field-b is null)

  5. Open field C? (Checkbox ye ...

Score: 0
How to show error on screen after failling a webservice call on Webform submitForm?
in flag

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  ...
Score: -3
Ella avatar
Webform update!
ng flag

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 ...

Score: -1
Akshar Vijay avatar
How can i change dateformat of webform submission
in flag

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?

Score: -1
Renato Francia avatar
Webform submissions to 3rd party API with Refresher Authentication token
id flag

How can you send the submitted information in a webform to a 3rd party API?

I have read this:

But it looks this recipe is more about updating a submission rather that doing requests.

Any help?


I realized I can use handlers for submission, but need to use a refresh authenticat ...

Score: 1
How to prevent theme change caused by $rendererService->renderPlain()
ru flag

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 ...