Drupal render form not rendering a form 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 

&lt;form id="" accept-charset="" method="" action=""&gt;


How do i generate  in second situation?
You should not print individual children elements of the form array, but render it completely (with render($form)).

If you want to fine tune the markup inside the &lt;form&gt; tag, you need to alter the form (using hook_form_FORM_ID_alter()) or provide a custom theme used for the form (i.e. in hook_theme() returns an items with the form ID as key).