- Issue created by @starlight-sparkle
ECA webform already exposes the alter element event in ECA, but as far as I know, it is not yet possible to set the element properties through any ECA action since the respective tokens are read-only.
My use case is to dynamically update the cardinality of a webform element based on a field value in the webform submission's source entity.
Without using ECA, doing so involves:
hook_webform_element_alter()
$element['#multiple']
$form_state->getFormObject()->getSourceEntity()
$element['#min_value']
to the field value$element['#add']
, $element['#remove']
, and $element['#add_more']
to FALSE
Currently, step 1 is already implemented in ECA webform, step 4 is possible through ECA content. Step 2 may be possible as well by just using ECA base and checking token values. Steps 3, 5, and 6 are not possible to perform.
$element
properties.Active
2.1
Code