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 11:33AM
    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 11:33AM
    You can also just unset it like so:
    unset($fields['id']);
  • edited 11:33AM
    Ah, Even better.
    thanks
Sign In or Register to comment.