FAPI Protection

  1. // AHAH and AJAX implementation
  2. // Get form from cache and store modified selection
  3. $form = form_get_cache($_POST['form_build_id'], $form_state);
  4.                  
  5. // update the select content
  6. $form['qualify'][$nextq]['#options'] = $matches['opt'][$mod]['data'];
  7.  
  8. // save cache
  9. form_set_cache($_POST['form_build_id'], $form, $form_state);
  10.  
  11. // Rebuild the form.
  12. $form_state = array('submitted' => FALSE);