With a multi-page webform.
- Page 1: choose country
- Page 2: choose industry
- Page 3: choose from a list of people that support the country and industry.
#validate handler added
$form['#validate'][] = '_cbifasttrackcert_webform_validate_sector_country';
Adding the items to the list
$verifier_options = $verifierHandler->formatVerifierOptions($verifiers);
$form['#node']->webform['components'][$choose_verifiers_cid]['extra']['items'] =
$verifier_options;
$form_state['webform']['component_tree']['children'][$choose_verifiers_cid]['extra']['items'] = $verifier_options;
Which is fine throughout the form, the values don't get submitted as there is a check that values are in the node list.
The challenge is to email a response based on the values, as only $submission is available.
When submitting a webform, node_load is used to load a clean version of the options in select.inc. These options are used to check whether any valid options have been submitted, with options not in the list being discarded.
web/sites/all/modules/contrib/webform/components/select.inc has _webform_select_options() with options to provide a callback or filter based on a token.
I'm not sure how to access form_state using either of these options? Similarly hook node_load does have form_state to allow the options to be discovered?
How to filter a select list based on a token? How to load the form data in a callback?