1

I'm building a Webform in Drupal 8. One section has repetitive grouped elements that could be added more than once. For instance, it's something like:

enter image description here

Where they could add more if they want. If this was a node, I'd use Paragraphs to create a bundle for the language name, writing proficiency and speaking proficiency, and they'd be able to add as many as they like. I'm not sure how to do it in the new D8 Webform module though. I know something like Webform Add More kinda works (though, it's really just hiding a preset number fieldsets until they're needed, not creating them dynamically), but I can't figure out anything else even close to that.

Should I just make a set, static number? Or is there another way? I know Webform is totally different now in D8, with YAML config files and how the data is stored; should I try to just make my own custom field in code?

  • Webform now supports composite elements. – troseman Oct 8 '17 at 7:09
  • Sorry, I haven't looked at this since July. Has something changed recently, or do you man the ability to make custom composite elements in code? I went with the latter, following the address field as an example, I believe. – UnsettlingTrend Oct 8 '17 at 13:58
  • yes, and there's more documentation around it. in the webform module, there's a sample composite in modules/examples. – troseman Oct 8 '17 at 16:46
1

If I gather correctly what you are asking then you are hitting https://www.drupal.org/node/2824714 . You need to write your own composite element, webform for now doesn't support this.

  • Yeah, I followed the address field field as an example to build out a new composite field. – UnsettlingTrend Oct 8 '17 at 13:59

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.