0 down vote favorite

I have a cutom module which creates a page with a custom form. the problem is that i don't print whole form at once like :

$form = drupal_get_form('custom_example_form', $adverts);
print render($form);

Rather my code is like:

$form = drupal_get_form('custom_example_form', $adverts);
print render($form['name']);
print render($form['descriere']);
print render($form['submit']);
print render($form['form_id']);
print render($form['form_build_id']);

The problem us that is second example drupal is not generating

<form id="" accept-charset="" method="" action="">

How do i generate in second situation?

Comments

joshi.rohit100’s picture

Try this:-

$form = drupal_get_form('custom_example_form', $adverts);
print drupal_render($form);