Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I have a problem. I have an form that contains:

$form['submit']['#ajax'] = array(
    "callback" => "site_basic_form_callback",
    "wrapper" => "ajaxBasicInfo",
    "effect" => "fade",
    'progress' => array('type' => 'throbber', 'message' => 'Sending information'),
  );

The callback:

function site_basic_form_callback($form, &$fstate){
 return $form;
}

And, when I call that form via ajax (hook_menu):

$items['site/get_form'] = array(
    'page callback' => 'site_get_form',
    'access callback' => TRUE,
    'type' => MENU_NORMAL_ITEM,
  );



function site_get_form() {
  $form = drupal_render(ajax_pre_render_element(drupal_get_form('site_basic_form', null)));
  echo $form;
}

The form resulted, don't make the ajax callback: "site_basic_form_callback", when I click on submit button only reload entery page.

share|improve this question
Hello, and welcome on Drupal Answers. You could also use 'drupal_get_form' as page callback, and array('site_get_form') as page arguments. Is there any reason you are using that code? – kiamlaluno Nov 23 '12 at 23:14

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.