2

I have a content type called "project" . I want to change the title of the submit button of the edit form. I wrote a module with the following:

function MYMODULE_form_alter(&$form, $form_state, $form_id) {  
  if ($form_id == 'project-node-form') {  
     $form['actions']['submit']['#value'] = t('Publish');  
  }  
}

I enabled this module but no change of the button title.

please help...thanks.

1 Answer 1

6

The form ID of the form alter function is wrong. It should have _ instead of -.

function MYMODULE_form_alter(&$form, $form_state, $form_id) {  
  if ($form_id == 'project_node_form') {  
     $form['actions']['submit']['#value'] = t('Publish');  
  }  
}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.