Change Search Bar Default Text via Form Alter

<?php
function YOURthemeORmodule_form_search_block_form_alter(&$form, &$form_state, $form_id) {
 $form['search_block_form']['#default_value'] = t('your default text');     
 $form['search_block_form']['#attributes'] = array('class' => array('your_class'), 
                                                              'onfocus' => "if (this.value == '". t('your default text'). "') {this.value = '';}",
                                                              'onblur' => "if (this.value == '') {this.value = '". t('your default text'). "';}"); 
 
}
?>
Help Share this Article