1
votes

can anyone help me how to add default text into my comment textarea. I do no how to override the comment-form in drupal 7. This is what i tried

function hook_form_alter(&$form, &$form_state, $form_id) {

 $form['comment-form'] = array(
 '#default_value' => t('Some default text'),
 '#title' => t('Field Title'),
'#type' => 'textarea',
 '#required' => FALSE,
 '#rows' => 10,

);

Here in my case the text area is located into in form.

Can anyone help me.

1

1 Answers

0
votes

You can use the hook THEMENAME_form_comment_form_alter in your template.php file.

Looks like everything else you're doing is right but in the wrong hook.