Created
March 21, 2014 21:20
-
-
Save ChezFre/9696767 to your computer and use it in GitHub Desktop.
Add placeholder to form elements in Drupal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * $vars['#id''] = Form ID, can be found via Krumo | |
| * $vars['field_name'] = Name of the input element you want to access | |
| */ | |
| function theme_form_alter(&$vars) { | |
| //krumo($vars); | |
| if( $vars['#id'] = " ") { | |
| $vars['field_name']['#attributes']['placeholder'] = "Placeholder"; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment