Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
By kus on
i am trying to set a default value for the body textarea in /node/add/story, but i must understand something wrong. the title works fine...but no body default value is beeing set. any hints?
function mymodule_form_alter($form_id, &$form) {
if ($form_id == 'story_node_form') {
// this works fine and sets the default value of title to "some title text"
$form['title']['#default_value'] = "some title text";
// why does this not set the body default value to "some body text" ?
$form['body']['#default_value'] = "some body text";
}
}
Comments
Try the following
Try the following instead:
Like this in D6...
what is this default channel
what is this default channel in function, where do i put this function?
Adriadrop Drupal development
He was showing you a function
He was showing you a function that he probably already used himself in another thread. You will need to rename the function according to the name of your module (or theme if you put it in a theme). What he showed you is an implementation of hook_form_alter().
Thanx Jay Was searchin for
Thanx Jay
Was searchin for something like http://drupal.org/node/497254
Adriadrop Drupal development