I need to alter the text of the search input field. In my quest to do this, I have dpm()
the content of $form
on a call to hook_form_search_box_form_alter()
. The output is the following.
Array
(
[search_block_form] => Array
(
[#type] => textfield
[#title] => Search
[#title_display] => invisible
[#size] => 15
[#default_value] =>
[#attributes] => Array
(
[title] => Enter the terms you wish to search for.
)
)
[actions] => Array
(
[#type] => actions
[submit] => Array
(
[#type] => submit
[#value] => Search
)
)
[#submit] => Array
(
[0] => search_box_form_submit
)
[#form_id] => search_block_form
[#type] => form
[#build_id] => form-Y0XlzH4YO-EqVHxg5wnRf-PrnecuUSGdo5LTCPcLgLU
[form_build_id] => Array
(
[#type] => hidden
[#value] => form-Y0XlzH4YO-EqVHxg5wnRf-PrnecuUSGdo5LTCPcLgLU
[#id] => form-Y0XlzH4YO-EqVHxg5wnRf-PrnecuUSGdo5LTCPcLgLU
[#name] => form_build_id
[#parents] => Array
(
[0] => form_build_id
)
)
[form_id] => Array
(
[#type] => hidden
[#value] => search_block_form
[#id] => edit-search-block-form
[#parents] => Array
(
[0] => form_id
)
)
[#id] => search-block-form
[#method] => post
[#action] => /
[#theme_wrappers] => Array
(
[0] => form
)
[#tree] =>
[#parents] => Array
(
)
[#validate] => Array
(
)
[#theme] => Array
(
[0] => search_block_form
[1] => search_box
)
)
Is $form['search_block_form']['#title'] = '';
the right thing to do here?
I need to alter the text of the search input field.
@Clive sounds like the placeholder to me How to modify the Search box input value?