I need to set up a Webform CiviCRM in Drupal with a component that can have multiple values (checkbox). But I need to establish its value based on the value of another field.

How can I set multiple values for the Checkbox component using conditionals?

Also, as the value of this multiple Checkbox depends on the value of another field, I need to keep the former value, and add a new one without removing the previous one.

I have included a screenshot of the conditionals.

enter image description here

With these conditions, they can only have a unique value and if the user selects more than one option on the field "Support you are looking for" the previous value of "Group(s)" is removed, so the last condition which is met is the one that establishes the value of "Group(s)".

Any help would very much appreciated.

  • If you're hiding the triggered fields from the user, _webform_submission_presave($node, &$submission) { should help in modifying the values before the submission is saved. If not - i think its better to implement this in custom js. – jitendra - fuzion Nov 13 '20 at 12:19
  • can you tag this Q with D7 or D8 since the approach differs – petednz - fuzion Nov 13 '20 at 19:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.