Hi to all! first of all thanks for this great module!
i want to use ahah helper with a submit button and replace method: i want to replace the value of the form element when i click a button ( or the form element with another form element), but i don´t realized how to do this with ahah. ( i used ahah helper with select and it works great). What i want to do seems easy but i can´t do.
Here my code:
in the example my form element is a 'markup' that shows a chart, what i want to do is to change a chart for other values based on $form_state values.


function estadisticas_dinamicas_form($form_state) {

drupal_set_title(t('Estadisticas'));
$form = array();
  ahah_helper_register($form, $form_state);	


  $form['example2'] = array(
      '#type' => 'fieldset',
      '#prefix' => '<div id="example2-wrapper">', // This is our wrapper div
      '#suffix' => '</div>',
      '#tree' => TRUE, // don't forget to set #tree!
      );
 $form['example2']['table'] = array(
	 '#type' => 'markup',
	 '#title' => t('test'),
	 '#default_value' => charts_graphs_test2($form_state),
	 '#value' => charts_graphs_test2($form_state));

 $form['submit']	= array(
      '#type' => 'submit',
      '#value' => t('Submit It'),
      '#ahah' => array(
        'event' => 'click',
        'path' => ahah_helper_path(array('example2')),
        'wrapper' => 'example2-wrapper',
        'method' => 'replace',
        //'progress' => 'none',
        'progress' => 'throbber',
        //'progress' => 'bar',
        ),
     );


 
	$form['#redirect'] = 'user';
	return $form;
}


function estadisticas_dinamicas_form_submit(&$form, &$form_state) {
// i test some code to put here but i don´t realized how replace or change the value of my markup

//$form_state['values']['example2']['table2'] = "hello";

//drupal_json(array('status' => TRUE, 'data' =>$form));
exit();
}
  
function charts_graphs_test2($form_state) {
// i want to access to $form_state values here and change my chart based in $form_state values
   $canvas = charts_graphs_get_graph('open-flash');
   
  $canvas->title = "OpenFlashCharts Chart";
  $canvas->type = "line";
  $canvas->y_legend = "Y Legend";
  $canvas->colour = '#808000';
  $canvas->width = 700;
  $canvas->height = 300;
  $canvas->series = array(
    'Some Value' => array(9,6,7,9,5,7,6,9,7),
    'Page Views' => array(6,7,9,5,7,6,9,7,3),
  );
  $canvas->x_labels = array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine');
 
  $out = $canvas->get_chart();

  return $out;
}

Anyone knows how can i do this or perhaps someone has an example of how to replace or update a form element with submit button.

Thanks for all,

Nicolás