By marcus7777 on
I get 'Fatal error: Cannot use string offset as an array in /home/artdept/public_html/includes/form.inc on line 976' when running this
<?php
function contact_form($form_state) {
$form['email'] = array( 'textfield',
'#title' => t('email address'),
'#size' => 30,
'#maxlength' => 64,
);
$form['subject'] = array(
'#type' => 'textfield',
'#title' => t('subject'),
'#size' => 30,
'#maxlength' => 64,
);
$form['message'] = array(
'#type' => 'textarea',
'#title' => t('Message'),
'#default_value' => '',
'#cols' => 60,
'#rows' => 5,
);
$form['submit'] = array('#type' => 'submit', '#value' => t(''));
return $form;
};
print drupal_get_form('contact_form');
can you see the problem?
many thanks
Marcus
Comments
#type missing in email element
should be
--------------------------------------------------------------
My attempt with Drupal - Jaanlo.com
cool thanks greylogic
cool thanks greylogic
same error
in d6 my problem was that form array was not initialized $form = array();