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

I am having some troubles with ajax on form element checkboxes, in ajax callback form_state is without values and triggering element etc .. why is that?

The form is called with drupal_get_form and this is my element

$form['select_options'] = array(
  '#type' => 'checkboxes',
  '#options' => $options, 
  '#ajax' => array(
    'callback' => 'ajax_options_callback',
    'wrapper' => 'options-form',
    'event' => 'change',
    'method' => 'replace',
  ),
);
share|improve this question
 
If $form_state['input'] there? and maybe you have set limit validation errors somehow? –  Mołot Aug 23 at 8:17
 
Please also share the code for ajax_options_callback function. –  Jayendra Kainthola Aug 23 at 8:33
1  
you haven't used default value this ajax, so when form will postback on ajax this will reset all fields on that page. –  Sanjay dev Aug 23 at 8:42

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.