html5 placeholder drupal search form


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // Add some cool text to the search block form
  2. function acq_margintest_form_alter(&$form, &$form_state, $form_id) {
  3. if ($form_id == 'search_block_form') {
  4. // HTML5 placeholder attribute
  5. $form['search_block_form']['#attributes']['placeholder'] = t('enter search terms');
  6. }
  7. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.