Append Fields to node form by ajax call I have a node form with some fields, now I want to append some more fields to it on an ajax callback. in the ajax page I have rendered the new form elements with drupal_render function
My problem is that I am not getting the newly built form fields in POST or form_state. 
Shall I use AHAH or can I continue with this ajax calls? 

$form['country'] = array( 
            "#type"=&gt;"select",   
            '#title'    =&gt;t('Ship To'), 
            '#required' =&gt; true ,
            '#options' =&gt; $options,
            '#weight' =&gt;10,
            '#attributes' =&gt;  array('id' =&gt; $cn_var),
        );
        $form['dyn_cost'] = array( 
            "#type"=&gt;"textfield",   
            '#title'    =&gt;t('Shipping Cost'),   
            '#required' =&gt; true ,
            '#size' =&gt;25,
            '#weight' =&gt;11,
            '#id' =&gt;  $co_var,
        );

        print drupal_render($form);
        exit;


This is my ajax form and it is supposed to be appending to the node form.
You can use Conditional Fields module to display form fields with certain conditions. No need to use custom ajax calls.


  Conditional Fields allows you to manage sets of dependencies between fields. When a field is “dependent”, it will only be available for editing and displayed if the state of the “dependee” field matches the right condition.