remove field elements

edited January 2012 in Modules
hey all,

What is the best way to remove items from a form. Example Date field, or even timestamp field. There are other items I will take care of on_before_save.

Thanks

Comments

  • edited 12:08PM
    I figured it out.
    function form_fields($values = array())
    {
    $values = array('name' => '', 'address'=>'', 'city'=>'', 'state'=>'', 'zip'=>'', 'phone'=>'', 'type'=>'');

    $fields = $values;

    //The key was id field
    $fields['id'] = array('type'=>'hidden');


    return $fields;
    }
  • edited 12:08PM
    You can also just unset it like so:
    unset($fields['id']);
  • edited 12:08PM
    Ah, Even better.
    thanks
Sign In or Register to comment.