I've got an exposed filter on my view that allows users to specify a date, and I want to specify a placeholder for this text field.
I've tried doing this using the following code in a hook:
$form['field_start_end_dates_value']['value']['#attributes'] = array('placeholder' => array(t('Search')));
(I know this is in the correct hook as I'm successfully altering other form elements within the same form)
I've var_dump
ed the form variable, and I'm getting the following output for the date filter:
[field_start_end_dates_value] => Array
(
[#tree] => 1
[value] => Array
(
[#title] =>
[#type] => date_text
[#size] => 20
[#default_value] =>
[#date_format] => j M Y
[#date_label_position] => within
[#date_year_range] => -3:+3
[#process] => Array
(
[0] => date_text_element_process
)
[#prefix] =>
[#suffix] =>
[#attributes] => Array
(
[placeholder] => Array
(
[0] => Specify Date
)
)
)
)
This looks right to me, but I'm not seeing the placeholder on the front end.
I've tried flushing the cache multiple times, and loading the page without JavaScript enabled.
What am I doing wrong?