I'm sure this must be possible, but I don't know anything about how js works with Drupal and I can't seem to find any; a) instructions or, b) examples that I can follow easily... Here's what I'd like to do:
I have several .inc files which contain (for example);
function tablemanager_field_barchart_name($field) {
return t('Bar Chart');
} // tablemanager_field_barchart_name
function tablemanager_field_barchart_table_form(&$form, $col, $default = "0\n500") {
$default = explode("\n", $default);
$form['dynamic']['low'.$col] = array(
'#type' => 'textfield',
'#title' => t('Enter lowest value enterable for bar charts'),
'#size' => 4,
'#maxlength' => 4,
'#default_value' => $default[0],
'#required' => TRUE,
);
$form['dynamic']['high'.$col] = array(
'#type' => 'textfield',
'#title' => t('Enter highest value enterable for bar charts'),
'#size' => 4,
'#maxlength' => 4,
'#default_value' => $default[1],
'#required' => TRUE,
);
} // tablemanager_field_barchart_table_form
I have a form hook which adds the form data to the form if the _table_form hook is selected from an array of the field names. At the moment the whole page needs to refresh when a new field type is selected to alter the extra settings which are displayed. (Just via an onClick... node-form.submit js call).
<?php
$form['add']['newheader'] = array(