Hello,

I want to get Rid of Preview and Submit buttons , those are default to any Entry Form in Drupal.

I want to do this using code , Like on some certain condition these shouldn't be visible.

Thanks,

Comments

evui’s picture

My suggestion is to understand the form api, (http://api.drupal.org/api/head/file/developer/topics/forms_api.html)
write a small module, and play with hook_form_alter (http://api.drupal.org/api/4.7/function/hook_form_alter).

My 2 cents.

evui’s picture

A quick and dirty solution (Drupal 4.7.x) is write a simple module and put in your module's hook_form_alter:

function hook_form_alter(&$form) {
  $unwanted_buttons = array('preview', 'submit');
  foreach ($unwanted_buttons as $b) {
    unset($form[$b]);
  }
}