<p>Fairly straightforward. Mostly here as a reminder for how to do <a href="http://drupal.org/project/webform">webforms</a> (example has a theoretical nid of 1 and a theoretical form field called "message" and the "submitted" part stymied me for a bit).</p>
<h3>template.php</h3>
<blockquote><?php function mytheme_form_webform_client_form_1_alter(&$form, &$form_state, $form_id) {
$form['submitted']['message']['#attributes']['placeholder'] = t('Type your message here...');
} ?></blockquote>
Could also use a switch in <code>hook_form_alter()</code>. One of these days I'll think about finding out if there's any difference performance-wise in using a big switch with many form alterations or several smaller <code>hook_form_form_id_alters</code>.
No comments yet
- Reply