I have succesfully changed the search button text of the block but can't seem to get to do this on the search page
on the following form_alter both forms enter it and are set but only search_block_form
gets affected
function MODULE_NAME_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
if(in_array($form_id,["search_block_form","search_form"])) {
$form['actions']['submit']['#value'] = "Custom Search Value";
}
}
I have also tried doing it with function hook_preprocess_input($vars){
and also tried to set the weight of the module to run later than others
function MODULE_NAME_install(){
module_set_weight('MODULE_NAME', 1000);
}
but I see no difference I had to resolve this using javascript what am I doing wrong ?