How can I disable cck button in node edit ?

I inserted code

if($form_id == 'page_node_form') {

$form[field_gmap_button] = array(
'#type' => 'hidden'
);

}

and remove button in node edit but in node view too and get error

warning: Invalid argument supplied for foreach() in C:\www\...sites\all\modules\cck\content.module on line 450.