Hello,
This is my code: function atleta_rankings_by_region_form($context) { $form['region'] = array( '#type' => 'select', '#title' => t('Select region'), '#options' => array( '' => '', 'area' => t('Area'), 'national' => t('National'), 'games' => t('Games & Cups'), 'event' => t('Custom region') ), '#ahah' => array( 'path' => 'atleta/rankings_by_region/ahah', 'wrapper' => 'atleta-ahah-wrapper', 'method' => 'replace', 'effect' => 'fade'), ); $form['markup'] = array( "#value" => '<div id="atleta-ahah-wrapper"></div>' ); function atleta_rankings_by_region_ahah() { switch ( $_POST['region'] ) { case 'area': $form['area'] = array( '#type' => 'select', '#title' => t('Select region'), '#options' => array( '' => '', '1' => 'Europe', '2' => 'Asia', '3' => 'Rest of the word' ), '#required' => TRUE ); $form['submit'] = array( '#type' => 'submit', '#value' => t('Select by Area'), '#weight' => 100 ); $output = drupal_render($form); break; } drupal_json(array('status' => TRUE, 'data' => $output)); }
I get the new form elements in the wrapper, but when I press the submit button, my atleta_rankings_by_region_form_submit and atleta_rankings_by_region_form_validate is not running. What I must to do for it?
Ámon Tamás Sitefejlesztő és programozó