By giustigianni on
With this code:
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Name'),
'#size' => 30,
'#maxlength' => 64,
'#description' => t('Enter the name for this group of settings'),
);
$output = form_render($form['name']);
return $output;
I Have this warning:
* warning: implode() [function.implode]: Bad arguments. in /var/www/drupal-4.7.3/includes/form.inc on line 303.
* warning: implode() [function.implode]: Bad arguments. in /var/www/drupal-4.7.3/includes/form.inc on line 303.
Where is the error?
I use:
Drupal 4.7, linux ubuntu 6.06, apache 2, php 5.1
P.S.
I use form_render to render the form into a table
Comments
drupal_get_form
You can use drupal_get_form: http://api.drupal.org/api/4.7/function/drupal_get_form
That will get rid of the warnings.
Yes, but drupal_get_form
Yes, but drupal_get_form make an vertical form.
I need a form in a table like this example:
http://drupal.org/node/47582
.....but I have the warning.
hand rendering
if you are determined that you want to hand render then you need to set
#parents. However, unless you know what you are doing (and you don't because you did not set it) you won't get what you wanted.As the other poster says, you rather need to use drupal_get_form and use the form API themeability capabilities rather than calling the renderer directly. You need to read http://api.drupal.org/api/HEAD/file/developer/topics/forms_api_reference... and http://drupal.org/node/33338 .
--
The news is Now Public | Drupal development: making the world better, one patch at a time.
--
Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.
perfect, now it is
perfect, now it is clear.....
thanks
bye
Gianni