By fumbling on
Trying to change the label on the submit button, currently labeled "save", on the create-content form on a specific content type. Can't use string overrides b/c the change is just for this content type. Could someone let me know what is wrong with my php in the following, where "customsite" is the name of the module I'm using, "local_post" is the name of the content type and "post" is the new label I want to assign to the button?
>
/**
* Override node-form
*/
function customsite_form_alter (&$form, $form_state, $form_id) {
if ($form_id == 'local_post_node_form')
$form ['submit']['#value'] = t('post');
}
<Right now, all it does is display "post" above the submit button, but it doesn't actually change the label of the submit button.
Thanks for any advice here.
Comments
So have the correct code now,
So have the correct code now, this works for anyone else out there interested:
In Drupal 7 the button is
In Drupal 7 the button is in:
$form['actions']['submit']['#value'] = t('post');Can it be done by theming?
Shouldn't this be possible by using a theme function?
All I want to do is change some names of buttons, but haven't found a way yet to do it in template.php.
Edit: I found a good answer here http://drupal.org/node/140387
Instead of running a case
Instead of running a case statement you can just use this more specific hook:
hook_form_FORM_ID_alter(&$form, &$form_state)
Where Go?
Where would this go? A separate customized module?
FYI I wrote about changing
FYI I wrote about changing the form submit values in my blog that shouldn't be too hard to follow.