0

I tried to simply extend the Date element in webforms like this

/**
 * Provides a 'birthday' element.
 *
 * @WebformElement(
 *   id = "birthday",
 *   label = @Translation("Birthday"),
 *   description = @Translation("Provides a custom form element for birthday date selection."),
 *   category = @Translation("Date/time elements"),
 * )
 */
class BirthdayElement extends Date {}

and I see and can select it in the build options. However when I click on the Test tab, I only see the Label and no date input field. What am I missing?

0

Webform elements require a Drupal Form API 'Element' plugin and 'WebformElement' plugin.

@see webform_example_element.module

| improve this answer | |
  • thank you for pointing that out, that solved my issue. – schaefdi Jun 15 at 9:41

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.