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"=>"select",
'#title' =>t('Ship To'),
'#required' => true ,
'#options' => $options,
'#weight' =>10,
'#attributes' => array('id' => $cn_var),
);
$form['dyn_cost'] = array(
"#type"=>"textfield",
'#title' =>t('Shipping Cost'),
'#required' => true ,
'#size' =>25,
'#weight' =>11,
'#id' => $co_var,
);
print drupal_render($form);
exit;
This is my ajax form and it is supposed to be appending to the node form.