I can quite easily add ajax autocomplete properties to a regular textfield using the code below, but it doesn't work when I change the field to type webform_email
. Is it possible to do?
function flower_order_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'webform_client_form_68911') {
//Add autocomplete fields for manager username
$form['submitted']['name_of_authorising_manager']['#autocomplete_path'] = 'user/autocomplete';
}
}
Here's the dpr output for the relevant field in the form:
Array
(
[#type] => webform_email
[#title] => Name of authorising manager:
[#title_display] => inline
[#default_value] =>
[#required] => 1
[#weight] => 4
[#description] =>
[#attributes] => Array
(
[class] => Array
(
[0] => email
)
)
[#element_validate] => Array
(
[0] => _webform_validate_email
)
[#theme_wrappers] => Array
(
[0] => webform_element
)
[#translatable] => Array
(
[0] => title
[1] => description
)
[#webform_component] => Array
(
[nid] => 68911
[cid] => 18
[pid] => 0
[form_key] => name_of_authorising_manager
[name] => Name of authorising manager:
[type] => email
[value] =>
[extra] => Array
(
[title_display] => inline
[private] => 0
[disabled] => 0
[unique] => 0
[width] =>
[description] =>
[attributes] => Array
(
)
[conditional_component] =>
[conditional_operator] => =
[conditional_values] =>
)
[mandatory] => 1
[weight] => 4
[page_num] => 1
)
[#webform_private] => 0
[#validated] => 1
[#webform_validated] =>
)
dpr()
orvar_dump()
it so we could readily see what Webform is doing with email fields?#ajax
or makes this fieldset or other structure. That's why I asked for a dump.dpr()
...find the bits that are relevant to your question, and extract those