Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

2

No one has contributed back a solution for Drupal 8. I think the best approach is going to be to organize cascading select menus using a CSV and implementing something like Cognito form's cascading dropdowns menus. Another supported approach is the Webform Simple Hierarchical Select module but it requires a taxonomy.


0

above solution is for the custom form. for Webform try this : https://www.drupal.org/forum/support/module-development-and-code-questions/2012-11-01/drupal-7-dynamic-select-list-in-the#comment-6677046


0

Have you tried #state in drupal form using that you can implement. see this: https://www.lullabot.com/articles/form-api-states


1

Yes you are so close! just move the creation of the new entity from your postSave() to right in the ajax call back example: _CUSTOM_MODULE_webform_submission_form_submit_ajax(array &$form, FormStateInterface $form_state) { // At this point we have all access to $form_state->getValues(); // the webform submission is all ready saved so we can use ...


1

Well above solution may work but it looks far too complex to my eyes. ;) I have achieved this on Drupal 8 by following below steps, Create a user view Load user data into fields Add relationship to "webform submissions" (Do not enable "Require this relationship") Add filter "Webform submission: Submitted by" Set that filter to "Is Empty (NULL)" This will ...


0

You have to use JS, go to settings - CSS/JS tab, write code in CUSTOM JAVASCRIPT textarea. Some code for reference. I got a text input (id is edit-name), a select (id is edit-gender), the id you find enter 'F12' to see. ID is automatically generated by Webform. When I select male, the text input will appear male. (function ($, Drupal) {'use strict';$(...


0

Is it possible that only two projects support SMTP authentication? https://www.drupal.org/project/phpmailer https://www.drupal.org/project/smtp Both still in beta. Typical mail server today won't send any mail without smtp authentication (not talking about VPS or spam services).


1

You must call ->entity to get the file entity, then you can call ->id() like this, $userprofile->field_usr_avatar_img->entity->id().


1

In your custom module add a folder src/Plugin/WebformHandler and create a file Subscription.php. Add the following code: <?php namespace Drupal\<mycustommodule>\Plugin\WebformHandler; use Drupal\Core\Form\FormStateInterface; use Drupal\webform\Plugin\WebformHandlerBase; use Drupal\webform\webformSubmissionInterface; /** * Form submission handler....


0

After looking through the webform module I found out how to achieve this. I used hook_webform_component_display_alter() which is there to enable customising the display of components in display only contexts. This function is in webform.api.php. I created my own function using this hook in a custom module to add the description to all textfield components ...


0

You can get the title & description with: $webform_submission->getWebform()->getElementsDecoded()['key_name']['#questions']['question value']; $webform_submission->getWebform()->getElementsDecoded()['key_name']['#answers']['answer value']; For Example: $webform_submission->getWebform()->getElementsDecoded()['test']['#questions'] ...


Top 50 recent answers are included